Re: how to get sequence list ?

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: ouyang_jw(at)hoperun(dot)com
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: how to get sequence list ?
Date: 2005-06-07 03:33:34
Message-ID: 20050607033334.GA40464@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Jun 07, 2005 at 09:42:12AM +0800, ouyang_jw(at)hoperun(dot)com wrote:
>
> I need to know whether a sequence object exists in postgresql.
> the sequence named "seq_serial".

In psql you can use the \d or \ds commands; otherwise you can query
the pg_class system catalog.

http://www.postgresql.org/docs/8.0/static/app-psql.html
http://www.postgresql.org/docs/8.0/static/catalog-pg-class.html

Alternatively, you could try to query the sequence itself:

SELECT * FROM seq_serial;

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2005-06-07 03:42:50 Re: pg_dump 8.0.3 failing against PostgreSQL 7.3.2
Previous Message Tom Lane 2005-06-07 03:00:49 Re: Postgresql fails to start?