How do I get the GRANT statements for a specified schema? Is there a way to generate the GRANT statements that have been run on a schema in PostgreSQL, for example if myUser has been granted usage on mySchema the script would generate

GRANT USAGE ON SCHEMA mySchema TO myUser;
Use pg_dump

pg_dump -d myDatabase --schema mySchema --section=pre-data |
  grep '^GRANT'


If you want just the GRANT on the schema object.

pg_dump -d myDatabase --schema mySchema --section=pre-data |
  grep '^GRANT .* ON SCHEMA .* TO'