how to get sequence list ?

Started by Nonamealmost 21 years ago3 messagesgeneral
Jump to latest
#1Noname
ouyang_jw@hoperun.com

Hello list,

I need to know whether a sequence object exists in postgresql.
the sequence named "seq_serial".

thank you .

OuYangJW

#2Michael Fuhr
mike@fuhr.org
In reply to: Noname (#1)
Re: how to get sequence list ?

On Tue, Jun 07, 2005 at 09:42:12AM +0800, ouyang_jw@hoperun.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/

#3Noname
ouyang_jw@hoperun.com
In reply to: Noname (#1)
Re: how to get sequence list ?

Michael Fuhr:
thanks!

through the method you supplied,i had resolved the problem.

OuYangJW

----- Original Message -----
From: "Michael Fuhr" <mike@fuhr.org>
To: <ouyang_jw@hoperun.com>
Cc: <pgsql-general@postgresql.org>
Sent: Tuesday, June 07, 2005 11:33 AM
Subject: Re: [GENERAL] how to get sequence list ?

Show quoted text

On Tue, Jun 07, 2005 at 09:42:12AM +0800, ouyang_jw@hoperun.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/