Skip to content

Instantly share code, notes, and snippets.

@xarimanx
Created December 4, 2018 23:13
Show Gist options
  • Save xarimanx/bfaa9df43f524a2d16255148c6c1d1ff to your computer and use it in GitHub Desktop.
Save xarimanx/bfaa9df43f524a2d16255148c6c1d1ff to your computer and use it in GitHub Desktop.
change owner of tables
$ for table in `psql -tc "select tablename from pg_tables where schemaname = '${SCHEMA}';" ${DB}` ; do psql -c "alter table ${SCHEMA}.${table} owner to ${OWNER}" ${DB} ; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment