In article <52EF20B2E3209443BC37736D00C3C1380AD5FEFF@xxxxxxxxxxxxxxxxxxxxxxxxx>, Albe Laurenz <all@xxxxxxxxxxxxxxxxx> 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 % from pg_constraint c join pg_class t on (c.conrelid = t.oid); or, perhaps simpler, select * from information_schema.table_constraints where constraint_type = 'PRIMARY KEY'; -- Patrick TJ McPhee North York Canada ptjm@xxxxxxxxxxxx