From: Michael Fuhr <mike@fuhr.org>
To: Thusitha Kodikara <kthusi@yahoo.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: Relationship beween sequences (serial) and tables
Date: Thu, 8 Sep 2005 06:42:48 -0600
Message-ID: <20050908124248.GA68650@winnie.fuhr.org> (raw)
In-Reply-To: <20050908080327.94284.qmail@web34405.mail.mud.yahoo.com>
References: <20050908080327.94284.qmail@web34405.mail.mud.yahoo.com>
On Thu, Sep 08, 2005 at 01:03:26AM -0700, Thusitha Kodikara wrote:
> In many of my tables the primary key is bigserial for which
> sequences are automatcially generated. Through pg_catalog tables
> how can I find the relationship petween each table and its corresponding
> sequence ?
Depending on what information you're looking for, you might need
to query any of the following tables:
pg_attrdef
pg_attribute
pg_class
pg_constraint
pg_depend
pg_index
See also "Miscellaneous Functions" ("System Information Functions"
in 8.x) in the "Functions and Operators" chapter of the documentation.
It can also be useful to run "psql -E" or use "\set ECHO_HIDDEN"
in psql to show the SQL queries that psql makes for \d commands.
--
Michael Fuhr
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: mike@fuhr.org, kthusi@yahoo.com
Subject: Re: Relationship beween sequences (serial) and tables
In-Reply-To: <20050908124248.GA68650@winnie.fuhr.org>
References: <20050908080327.94284.qmail@web34405.mail.mud.yahoo.com> <20050908124248.GA68650@winnie.fuhr.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox