Re: OID Usage

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Bo Lorentsen <bl(at)netgroup(dot)dk>
Cc: "pgsql-general postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: OID Usage
Date: 2005-01-14 19:20:50
Message-ID: 20050114192050.GA18968@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message SCassidy 2005-01-14 19:36:26 to_char(interval, text) deprecated in future - how do we get consistent interval output without it?
Previous Message Martijn van Oosterhout 2005-01-14 19:14:06 Re: OID Usage