Grants and Priv in  Greenplum

sachi=# select schemaname,viewname from pg_views where viewname like '%priv%'; schemaname | viewname --------------------+---------------------- information_schema | table_privileges information_schema | usage_privileges information_schema | data_type_privileges information_schema | column_privileges information_schema | routine_privileges (5 rows) sachi=#

sachi=# select schemaname,viewname from pg_views where viewname like '%rol%';

     schemaname     |             viewname              

--------------------+-----------------------------------

 gp_toolkit         | gp_resq_role

 pg_catalog         | pg_roles

 information_schema | applicable_roles

 information_schema | administrable_role_authorizations

 information_schema | enabled_roles

 information_schema | role_column_grants

 information_schema | role_routine_grants

 information_schema | role_table_grants

 information_schema | role_usage_grants

 gp_toolkit         | gp_roles_assigned

(10 rows)

UNIX Way

$pg_dump -s  -c sachi |egrep "${SCHEMAS}\..*OWNER TO" >>privilagesddl.sql