$ psql -qAt -d mydatabase -c "SELECT 'ALTER TABLE '||schemaname||'.'||tablename||' OWNER TO new_owner;' FROM pg_tables WHERE schemaname = 'myschema'" > data.txt
$ psql < data.txt -d mydatabase
source : http://penningpence.blogspot.fr/2014/09/changing-owner-of-multiple-database.html
Laisser un commentaire