PostgreSQL – How to get the List of All Schemas
To retrieve a list of all schemas in a PostgreSQL database, you can use the following SQL query:
SELECT schema_name FROM information_schema.schemata;
This query queries the information_schema.schemata
view, which contains information about all the schemas in the current database. When you execute this query, it will return a list of schema names present in the current database.