Re: [GENERAL] how to save primary key constraints

2011-10-12 Thread Merlin Moncure
On Tue, Oct 11, 2011 at 6:37 PM, Chris Travers chris.trav...@gmail.com wrote: On Tue, Oct 11, 2011 at 4:33 PM, Raymond O'Donnell r...@iol.ie wrote: On 12/10/2011 00:24, J.V. wrote: pg_catalog table does not exist. It's not a table, it's PostgreSQL's version of the information_schema

[GENERAL] how to save primary key constraints

2011-10-11 Thread J.V.
I need to be able to query for all primary keys and save the table name and the name of the primary key field into some structure that I can iterate through later. How would I go about this? I want to hard code the number of tables and be able to iterate through some structure to get the

Re: [GENERAL] how to save primary key constraints

2011-10-11 Thread John R Pierce
On 10/11/11 2:16 PM, J.V. wrote: I need to be able to query for all primary keys and save the table name and the name of the primary key field into some structure that I can iterate through later. How would I go about this? I want to hard code the number of tables and be able to iterate

Re: [GENERAL] how to save primary key constraints

2011-10-11 Thread Joe Abbate
On 10/11/2011 05:16 PM, J.V. wrote: I need to be able to query for all primary keys and save the table name and the name of the primary key field into some structure that I can iterate through later. How would I go about this? I want to hard code the number of tables and be able to iterate

Re: [GENERAL] how to save primary key constraints

2011-10-11 Thread J.V.
pg_catalog table does not exist. This is a solution for PostgreSQL 8.4. If you know of a way I can get all primary key fields or have a query that will work in 8.4, please help. I have done a lot of research and cannot find a simple way. J.V. On 10/11/2011 3:29 PM, John R Pierce wrote:

Re: [GENERAL] how to save primary key constraints

2011-10-11 Thread Raymond O'Donnell
On 12/10/2011 00:24, J.V. wrote: pg_catalog table does not exist. It's not a table, it's PostgreSQL's version of the information_schema catalog: http://www.postgresql.org/docs/8.4/static/catalogs.html Ray. -- Raymond O'Donnell :: Galway :: Ireland r...@iol.ie -- Sent via pgsql-general

Re: [GENERAL] how to save primary key constraints

2011-10-11 Thread Chris Travers
On Tue, Oct 11, 2011 at 4:33 PM, Raymond O'Donnell r...@iol.ie wrote: On 12/10/2011 00:24, J.V. wrote: pg_catalog table does not exist. It's not a table, it's PostgreSQL's version of the information_schema catalog:  http://www.postgresql.org/docs/8.4/static/catalogs.html Not quite.

Re: [GENERAL] how to save primary key constraints

2011-10-11 Thread John R Pierce
On 10/11/11 4:24 PM, J.V. wrote: pg_catalog table does not exist. This is a solution for PostgreSQL 8.4. pg_catalog is a schema that has about 150 views and tables in it. pg_tables is one such, as is pg_indexes (these two are both views) you do realize, the primary key might not BE a

Re: [GENERAL] how to save primary key constraints

2011-10-11 Thread Ondrej Ivanič
Hi, On 12 October 2011 08:16, J.V. jvsr...@gmail.com wrote: I need to be able to query for all primary keys and save the table name and the name of the primary key field into some structure that I can iterate through later. psql -E is your friend here. Then use \d table and you get several