3 Ways to list all schemas in PostgreSQL
Dec 14th, 2020,There are 3 ways to list all available schemas in PostgreSQL:
1. Using SQL Query
We can list all PostgreSQL schemas using the (ANSI) standard INFORMATION_SCHEMA:
SELECT schema_name FROM information_schema.schemata;
Alternatively, we can use:
SELECT nspname FROM pg_catalog.pg_namespace;
Sample results
As a result, you will get a list of all available schemas:
More details about The information schema.
2. Using psql
If you are using psql, you can list all schemas simply by using the following command: \dn
3. With ERBuilder Data Modeler
With ERBuilder Data Modeler, you can visualize all the available schemas (except the empty ones) in your PostgreSQL at the left Treeview explorer.
ERBuilder provides a data model browser which is an exploration module build for a full and deep exploration of the data structure extracted from your databases. You can use the advanced search to filter tables by schema name.
You can also drag and drop objects from the data model browser to the diagram area and edit them to build an ERD that suits your needs.
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!