SQL to extract column metadata

From: "Scott Ford" <Scott(dot)Ford(at)bullfrogpower(dot)com>
To: <pgsql-novice(at)postgresql(dot)org>
Subject: SQL to extract column metadata
Date: 2008-01-15 23:46:38
Message-ID: F7653F642E0F8E4F9F5D6FD8ED0159ABD989DC@CX43.800onemail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi Everyone -

I'm looking for a SQL statement that I can use to find out if a given
column in a table uses a specific sequence as it's next default value.
Is this possible?

For example, if the table was created with:

CREATE TABLE accounts
(
account_id integer NOT NULL DEFAULT
nextval(('accounts_account_id_seq'::text)::regclass),
account_number character varying(40) NOT NULL
)

Is there a way for me to query the database metadata to verify that
accounts.account_id uses the sequence accounts_account_id_seq as it's
default next value?

Thanks in advance!

Scott.

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Peter Jackson 2008-01-15 23:57:45 Re: msaccess to postgre
Previous Message Obe, Regina 2008-01-15 13:54:47 Re: msaccess to postgre