Search Postgresql Archives

check for primary key

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hey guys!

I would like to know how to query for the existence of a primary key on
a table. All of the tables have the column 'id' in them. That should be
the primary key. However, the primary key constraint got "lost" somehow.
Probably due to stupidity on my part.

I just want to add back the primary key constraint to the tables that
lost it. I want to query for the existance of it first, so I don't
produce an error when I do an 'ALTER TABLE ...' statement.

Any suggestions appreciated.

Thanks!
Tom


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux