How to find all current sequence IDs

From: "Campbell, Lance" <lance(at)illinois(dot)edu>
To: "pgsql-sql(at)lists(dot)postgresql(dot)org" <pgsql-sql(at)lists(dot)postgresql(dot)org>
Subject: How to find all current sequence IDs
Date: 2024-02-21 22:06:55
Message-ID: SJ0PR11MB562974ADFAF0F0CFB72A8B6DDE572@SJ0PR11MB5629.namprd11.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Is there a way to get a list of all sequences, the schema it is used in, and the current sequence number in use?

The below SQL will give me the schema and sequences. It does not give me the current sequence number in use.

SELECT sequence_schema, sequence_name
FROM information_schema.sequences
ORDER BY sequence_name ;

Thanks,

Lance Campbell
University of Illinois

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Tom Lane 2024-02-21 22:13:56 Re: How to find all current sequence IDs
Previous Message Tom Lane 2024-02-07 23:30:17 Re: POSTGRES 15 - CONSTRAINT TRIGGER CREATION