Le mercredi 08 mai 2013 à 14:11 -0700, Jeff Janes a écrit :
> Let's say you have a database which is owned (as well as all the
> contents within it) by the postgres internal user.  
> 
> 
> Having created or inherited a mess, how do you fix it?
> 

with sed on Linux/Unix, you could do this :

pg_dump -f mess.out mess

sed -i 's/OWNER TO postgres/OWNER TO proper_username/' mess.out

createdb clean

psql -f mess.out clean

You'll also want to modify the REVOKE ALL ON SCHEMA/GRANT ALL ON SCHEMA
that are at the end of the dump file

-- 
Salutations, Vincent Veyron
http://marica.fr/site/demonstration
Logiciel de gestion des contentieux juridiques et des sinistres d'assurance



-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to