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.

Revisions

  1. xarimanx created this gist Dec 4, 2018.
    1 change: 1 addition & 0 deletions bash.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    $ 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