Re: [GENERAL] Can a function determine whether a primary key constraint exists on a table?

2006-10-13 Thread Patrick TJ McPhee
In article <[EMAIL PROTECTED]>, Albe Laurenz <[EMAIL PROTECTED]> wrote: % > How can I check for the % > presence of constraints inside a function? % % select t.oid as tableid, t.relname as tablename, % c.oid as constraintid, conname as constraintname % f

Re: [GENERAL] Can a function determine whether a primary key constraint

2006-10-12 Thread Alban Hertroys
Rob Richardson wrote: Greetings! I recently joined a company that uses a fairly small PostGres database. I have never used PostGres before, but I am familiar with (but not expert in) SQL Server. The PostGres database has 90 tables (including Welcome. the one I just added). When the data

Re: [GENERAL] Can a function determine whether a primary key constraint exists on a table?

2006-10-12 Thread Albe Laurenz
> The PostGres > database has 90 tables (including the one I just added). [...] > I would like to write a function that would add a > column to a table, populate it with the number 1 to n (where > n is the number of rows in the table), make that c

[GENERAL] Can a function determine whether a primary key constraint exists on a table?

2006-10-12 Thread Rob Richardson
Greetings!   I recently joined a company that uses a fairly small PostGres database.  I have never used PostGres before, but I am familiar with (but not expert in) SQL Server.  The PostGres database has 90 tables (including the one I just added).  When the database was originally develope