What SCRIPT in Postgres to list all Schemas?

0

I need to know which script I use to list all the Schemas in a Database? 1 Condition is listing all Schemas I have created and do not need Postgres Schemas I need this information to be able to automatically generate access permissions for users to all schemas through a Function

    
asked by anonymous 01.01.2019 / 16:24

1 answer

1

This simple command will return you the schemas you created in the database plus schema public

select 
    schema_name
from 
    information_schema.schemata
where
    schema_name !~ '^pg_' AND 
    schema_name <> 'information_schema'
    
01.01.2019 / 16:24