Scot L. Harris wrote:
Using PHP 4.2.2 and postgresql 7.2.4.
Trying to find a way to identify the primary key of a table given just the tables name.
I don't have a quick answer but can point you to where you can hopefully find what you are looking for. Try looking at the queries in this class:
http://creole.tigris.org/source/browse/creole/creole/classes/creole/drivers/pgsql/metadata/PgSQLTableInfo.php
Creole is a PHP5 db abstraction layer that, among other things, has methods to get primary key info from db metadata. I think the answer to your question (and possibly others about pgsql metadta) will be present in that class. I had some help in getting that to work correctly.
Cheers, Hans
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php