soscmd/soscmd-postgresql-changeowner.txt
2024-03-15 02:18:24 +01:00

1 line
168 B
Text

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