It's rumoured that Hiroshi Saito once said: > ---------------------------------------------------------------- > saito=# SELECT cls.oid, cls.relname as idxname, indrelid, indkey, > indisclustered, indisunique, indisprimary, n.nspname, > indnatts, tab.relname as tabname, indclass, description, > pg_get_expr(indpred, indrelid, true) as indconstraint, contype, > condeferrable, condeferred, amname > FROM pg_index idx > JOIN pg_class cls ON cls.oid=indexrelid > JOIN pg_class tab ON tab.oid=indrelid > JOIN pg_namespace n ON n.oid=tab.relnamespace > JOIN pg_am am ON am.oid=cls.relam > LEFT OUTER JOIN pg_description des ON (des.objoid=cls.oid AND > des.objsubid = 0) LEFT OUTER JOIN pg_constraint con ON > con.conrelid=indrelid AND conname=cls.relname > WHERE cls.relname = 'MyTransaction_pkey';
Hi Hiroshi, I don't have a system to test this on at the moment so I may have missed something... You are joining to pg_description using pg_class.oid. This will return the comment for the table. Try joining to pg_constraint.oid so it uses the pkey records oid. Regards, Dave. ---------------------------(end of broadcast)--------------------------- TIP 7: don't forget to increase your free space map settings