Re: Restoring a database as another user

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Restoring a database as another user
Дата
Msg-id 688.1146234330@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Restoring a database as another user  ("David Garamond" <davidgaramond@gmail.com>)
Список pgsql-admin
"David Garamond" <davidgaramond@gmail.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

В списке pgsql-admin по дате отправления:

Предыдущее
От: "Ben K."
Дата:
Сообщение: Re: Is there an efficient way to check whether a particular
Следующее
От: "Benjamin Krajmalnik"
Дата:
Сообщение: Re: New system recommendations