public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: Campbell, Lance <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: How to find all current sequence IDs
Date: Wed, 21 Feb 2024 17:13:56 -0500
Message-ID: <[email protected]> (raw)
In-Reply-To: <SJ0PR11MB562974ADFAF0F0CFB72A8B6DDE572@SJ0PR11MB5629.namprd11.prod.outlook.com>
References: <SJ0PR11MB562974ADFAF0F0CFB72A8B6DDE572@SJ0PR11MB5629.namprd11.prod.outlook.com>

"Campbell, Lance" <[email protected]> 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





view thread (4+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: How to find all current sequence IDs
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox