Skip to content

Instantly share code, notes, and snippets.

@weldpua2008
Created January 15, 2017 08:22
Show Gist options
  • Save weldpua2008/daabf6d69212a1245e09ed245f9a8c4f to your computer and use it in GitHub Desktop.
Save weldpua2008/daabf6d69212a1245e09ed245f9a8c4f to your computer and use it in GitHub Desktop.
How to grant all psgress tables in RDS to portal
psql_host=.us-east-1.rds.amazonaws.com
for i in `echo '\d' | psql -h ${psql_host} -U postgres -d informationmodel |grep public|awk '{print $3}'`; do psql -h ${psql_host} -U postgres -d informationmodel -c "grant all on table $i to portal;"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment