Re: Restore option disabled for non-superuser

Поиск
Список
Период
Сортировка
От Konstantin Pelepelin
Тема Re: Restore option disabled for non-superuser
Дата
Msg-id 4D0899FF.1020107@dtf.ru
обсуждение исходный текст
Ответ на Re: Restore option disabled for non-superuser  (Guillaume Lelarge <guillaume@lelarge.info>)
Ответы Re: Restore option disabled for non-superuser  (Guillaume Lelarge <guillaume@lelarge.info>)
Список pgadmin-support
15.12.2010 9:48, Guillaume Lelarge пишет:
> Le 14/12/2010 22:35, Konstantin Pelepelin a écrit :
>> PgAdmin 1.12.2 on WindowsXP
>> postgresql 9.0 on linux
>>
>> When connecting as 'postgres', 'Restore' option is available, but when
>> connecting as 'testuser' (simple user, nocreatedb), even for database
>> owned by testuser, restore options are greyed out.
>>
>> I think they should not be disabled, in many scenarios db may be
>> restored by non-superuser.
>>
>
> I didn't checked, don't have the time right now. But I read the source
> code. It seems you only need to have the CREATE priviledge in the
> database. So no need to be superuser or to have the createdb priviledge,
> but you need to be a user who can create objects in that database. Which
> seems fine to me.

I can restore with pg_restore, but cannot with pgadmin in my case.

I do no specific rights management usually. I don't know much about 
them, but seems it's not enough.

I do simple steps. PG is installed from rpm, local connections are 
'trust' and remote are 'md5' in pg_hba.conf. createuser, set passwords

Then I create DB locally with
createdb -U postgres -E KOI8 --locale ru_RU.KOI8-R --template template0 
testdb
I don't think locale setting matters here, so it could be simply
createdb -U postgres testdb

Then I restore a database remotely with command
pg_restore -h server -1 -U testuser -v -S postgres --disable-triggers 
--no-owner -Ft -d testdb -L pg_restore_list.txt backup.tar

And everything is restored fine.

But option 'restore' is disabed in pgadmin if I log in as testuser. (And 
if I log in as postgres, I cannot use --no-owner to reset all ownership 
to testuser, so it seems I would have to change owners by some script)

Thanks,
Konstantin



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

Предыдущее
От: Guillaume Lelarge
Дата:
Сообщение: Re: Restore option disabled for non-superuser
Следующее
От: Dmitry Mordovin
Дата:
Сообщение: pgAgent question