Re: How to find all current sequence IDs - Mailing list pgsql-sql

From Tom Lane
Subject Re: How to find all current sequence IDs
Date
Msg-id 174178.1708553636@sss.pgh.pa.us
Whole thread Raw
In response to How to find all current sequence IDs  ("Campbell, Lance" <lance@illinois.edu>)
Responses Re: How to find all current sequence IDs
List pgsql-sql
"Campbell, Lance" <lance@illinois.edu> writes:
> Is there a way to get a list of all sequences, the schema it is used in, and the current sequence number in use?

Try something like

select relname, relnamespace::regnamespace, pg_sequence_last_value(oid)
from pg_class where relkind = 'S';

            regards, tom lane



pgsql-sql by date:

Previous
From: "Campbell, Lance"
Date:
Subject: How to find all current sequence IDs
Next
From: Nisarg Patel
Date:
Subject: Re: How to find all current sequence IDs