createuser -U postgres -D -R -S aws_user
1 2 | alter user aws_user with encrypted password 'MY PASSWORD' ; grant connect on database dwhmbqt to aws_user; |
1 2 3 4 5 6 7 8 9 10 11 12 13 | do $$ declare _query text; _schema text; begin for _schema in select nspname from pg_namespace where nspname ~ '_db$' loop _query := format( 'grant usage on schema %I to aws_user' , _schema); raise notice '%' , _query; execute _query; end loop; end ; $$ |
1 2 3 4 5 6 7 8 9 10 11 12 13 | do $$ declare _query text; _schema text; begin for _schema in select nspname from pg_namespace where nspname ~ '_db$' loop _query := format( 'grant select on all tables in schema %I to aws_user' , _schema); raise notice '%' , _query; execute _query; end loop; end ; $$ |
host dwhmbqt aws_user 10.192.0.0/16 md5