Blog‎ > ‎

Perl script to rename Postgres user in dump file

posted Dec 19, 2008, 3:56 PM by Jade Rubick
Perl script to rename Postgres user in dump file

perl -pi -e "s/^\\connect olduser$/\\connect newuser/" filename
Thanks, Dave, Dossy, and Til.

To load in the database dump:

psql -f filename dbusername
Comments