Which Postgres SCRIPT to list all Schemas?

Asked

Viewed 150 times

0

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

1 answer

1

This simple command will return to Voce the schemas that Voce created in the database plus the public schema

select 
    schema_name
from 
    information_schema.schemata
where
    schema_name !~ '^pg_' AND 
    schema_name <> 'information_schema'

Browser other questions tagged

You are not signed in. Login or sign up in order to post.