Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search for
  Advanced Search

Re: Restoring a database as another user



"David Garamond" <davidgaramond(at)gmail(dot)com> writes:
> My goal is to restore someone's (e.g. Jim's) database by the superuser to be
> owned by a new user (e.g. Bob). Jim and Bob connects using password and I
> (the superuser) do not know their passwords.

I think you'd need a two-step process:

	pg_restore --no-owner mydb.dump >mydb.script

	psql -U superuser template1
	psql=> create database foo owner bob;
	psql=> \c foo
	psql=> set session authorization bob;
	psql=> \i mydb.script


			regards, tom lane



Home | Main Index | Thread Index

Privacy Policy | PostgreSQL Archives hosted by Command Prompt, Inc. | Designed by tinysofa
Copyright © 1996 – 2008 PostgreSQL Global Development Group