Re: OID Usage - Mailing list pgsql-general

From Michael Fuhr
Subject Re: OID Usage
Date
Msg-id 20050114192050.GA18968@winnie.fuhr.org
Whole thread Raw
In response to Re: OID Usage  (Bo Lorentsen <bl@netgroup.dk>)
Responses Re: OID Usage  (Alvaro Herrera <alvherre@dcc.uchile.cl>)
Re: OID Usage  (Bo Lorentsen <bl@netgroup.dk>)
List pgsql-general
On Fri, Jan 14, 2005 at 07:44:18PM +0100, Bo Lorentsen wrote:
> Alvaro Herrera wrote:
>
> >You can create a function to get the sequence name attached to a table.
> >Of course, you should take into account the fact that there could be
> >more than one (two serial fields in a table are rare but not
> >impossible), but if your tables have only one sequence you should be OK.
> >
> Are there a way to find and test if it is a primary key ?

pg_index has an indisprimary column.

> Hmm, need to play more around using the "pg_" system tables.
>
> Are they all well documentet, or need I some guessing ?

See the "System Catalogs" chapter in the documentation.

If you run "psql -E" you'll see the queries that psql executes for
commands like "\d foo".  Those commands query the system catalogs.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

pgsql-general by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: OID Usage
Next
From: PFC
Date:
Subject: MOVE