Re: Dump tables with pg_dump - no or different Owner - Mailing list pgsql-general

From Alex Satrapa
Subject Re: Dump tables with pg_dump - no or different Owner
Date
Msg-id 4003202A.5070201@lintelsys.com.au
Whole thread Raw
In response to Dump tables with pg_dump - no or different Owner  (Victor Spång Arthursson <victor@tosti.dk>)
List pgsql-general
Victor Spång Arthursson wrote:
> Have a problem, probably easy to solve... I want to dump a database
> which resides on my local server with another, and not existing, owner
> than the one who actually owns it locally.

If the whole database is going to be owned by one user, try dumping the
tables like this:

pg_dump --no-privileges --no-owner --no-reconnect ... > tables.sql

Then load the tables as the new owner on the new database.

An alternative is to process the SQL dump using perl:

perl -p -i -e 's/old-owner-name/new-owner-name/g' tables.sql


HTH
Alex Satrapa


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Case sensitivity
Next
From: Tom Lane
Date:
Subject: Re: Vacuum Error