Re: Restore option disabled for non-superuser

From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: Konstantin Pelepelin <cat(at)dtf(dot)ru>
Cc: pgadmin-support(at)postgresql(dot)org
Subject: Re: Restore option disabled for non-superuser
Date: 2010-12-19 13:29:21
Message-ID: 4D0E08B1.4000007@lelarge.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

Le 15/12/2010 11:35, Konstantin Pelepelin a écrit :
> 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)
>

Actually, you were right. I fixed the issue. Thanks for your report.

--
Guillaume
http://www.postgresql.fr
http://dalibo.com

In response to

Browse pgadmin-support by date

  From Date Subject
Next Message Peter Oram 2010-12-19 23:55:05 Re: Problem installing pgadmin3-1.12.1
Previous Message Dave Page 2010-12-19 10:43:11 Re: How to extend the Pgadmin