From: Nisarg Patel <er.nisarg@gmail.com> Sent: Wednesday, February 21, 2024 5:17 PM To: Tom Lane <tgl@sss.pgh.pa.us> Cc: Campbell, Lance <lance@illinois.edu>; pgsql-sql@lists.postgresql.org Subject: Re: How to find all current sequence IDs
"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';