How to list sequences in PostgreSQL database
Aug 08th, 2021,If you are trying to list all sequences in the PostgreSQL database. You can do so with one of the methods in this article.
1. Using SQL Query
The first way would be using an SQL query to show all sequences in a PostgreSQL database. The following script can get all data needed:
SELECT sequence_schema, sequence_name FROM information_schema.sequences ORDER BY sequence_name
Sample results
Sample result of the query:
2. Using psql
Another method is to use psql \ds command to list all sequences in a PostgreSQL database.
3. Using ERBuilder Data Modeler
ERBuilder Data Modeler allows you to visualize your database structures which means you will be capable of listing all sequences in your PostgreSQL database.
With ERBuilder Data Modeler, you can view the details of a sequence just by double-clicking on it from the list. As you can add a new sequence, edit an exciting one or delete the one you don’t need anymore, you can also view the sequence’s SQL script.
How ERBuilder Helps
ERBuilder Data Modeler is a GUI data modeling tool that allows you to visualize, design and model databases by using entity relationship diagrams and automatically generates the most popular SQL databases including Amazon Redshift. Generate and share the data Model documentation with your team. Optimize your data model by using advanced features such as test data generation, schema compare and schema synchronization. Try now ERBuilder for 15 days FREE
Subscribe To Our Newsletter
Subscribe to our email newsletter today to receive updates of the latest news, tutorials and special offers!