how to get sequence list ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

how to get sequence list ?

ouyang_jw
Hello list,
 
I need to know whether a sequence object exists in postgresql.
the sequence named "seq_serial".
 
thank you .
 
OuYangJW
Reply | Threaded
Open this post in threaded view
|

Re: how to get sequence list ?

Michael Fuhr
On Tue, Jun 07, 2005 at 09:42:12AM +0800, [hidden email] 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/

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to [hidden email] so that your
      message can get through to the mailing list cleanly
Reply | Threaded
Open this post in threaded view
|

Re: how to get sequence list ?

ouyang_jw
Michael Fuhr:
thanks!

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

OuYangJW


----- Original Message -----
From: "Michael Fuhr" <[hidden email]>
To: <[hidden email]>
Cc: <[hidden email]>
Sent: Tuesday, June 07, 2005 11:33 AM
Subject: Re: [GENERAL] how to get sequence list ?


> On Tue, Jun 07, 2005 at 09:42:12AM +0800, [hidden email] 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/
>
>



---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to [hidden email]