Hi.
I'm trying to write a select statement that does the following;
select all tables in my database;
for each table, select all columns, and tell me if the column is a
primary key
in the table.
I've tried this by querying pg_class, pg_index and pg_attribute, but I
have a problem when I this is supposed to be "general", ie I do not
know the maximum number of columns in a primary key (I can't use
subscription of "indkey").
Is there a way of testing for membership in an int2vector-field? For
example:
select column, "prim.key" from ... where pg_attribute.attnum in
pg_index.indkey
??
Thanks!
-Jostein