soscmd/soscmd-postgresql-changeowner.txt

2 lines
168 B
Text
Raw Normal View History

for tbl in `psql -qAt -c "select tablename from pg_tables where schemaname = 'public';" YOUR_DB` ; do psql -c "alter table \"$tbl\" owner to NEW_OWNER" YOUR_DB ; done