restoring under a different owner?

Started by Christopher J. Bottaroabout 20 years ago3 messagesgeneral
Jump to latest
#1Christopher J. Bottaro
cjbottaro@alumni.cs.utexas.edu

Hi,
I want to use pg_dump to backup an entire Postgres database, including BLOB
data. Then I want to restore it on a different machine with a different db
owner and all the tables restored under that owner. I want the restore to
create the db and all the tables.

What are the commands to do this?

Thank you.

#2John DeSoi
desoi@pgedit.com
In reply to: Christopher J. Bottaro (#1)
Re: restoring under a different owner?

On Feb 19, 2006, at 3:25 PM, Christopher J. Bottaro wrote:

I want to use pg_dump to backup an entire Postgres database,
including BLOB
data. Then I want to restore it on a different machine with a
different db
owner and all the tables restored under that owner. I want the
restore to
create the db and all the tables.

What are the commands to do this?

See the --no-owner option with pg_restore (also available with pg_dump).

http://www.postgresql.org/docs/8.0/interactive/app-pgrestore.html

John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Christopher J. Bottaro (#1)
Re: restoring under a different owner?

"Christopher J. Bottaro" <cjbottaro@alumni.cs.utexas.edu> writes:

I want to use pg_dump to backup an entire Postgres database, including BLOB
data. Then I want to restore it on a different machine with a different db
owner and all the tables restored under that owner. I want the restore to
create the db and all the tables.

Something involving --no-owner should work for you. See the pg_dump man page.

regards, tom lane