Allow for changing owner of all tables in psql db
This commit is contained in:
parent
d71f8f7e01
commit
ef3e134c11
2 changed files with 3 additions and 0 deletions
2
soscmd-postgresql-changeowner
Executable file
2
soscmd-postgresql-changeowner
Executable file
|
@ -0,0 +1,2 @@
|
||||||
|
echo "Execute this:"
|
||||||
|
cat /opt/soscmd/soscmd-postgresql-changeowner.txt
|
1
soscmd-postgresql-changeowner.txt
Normal file
1
soscmd-postgresql-changeowner.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
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
|
Loading…
Reference in a new issue