Re: Can I check if somebody is superuser in stored procedure?

Поиск
Список
Период
Сортировка
От David Fetter
Тема Re: Can I check if somebody is superuser in stored procedure?
Дата
Msg-id 20110327220559.GF20196@fetter.org
обсуждение исходный текст
Ответ на Can I check if somebody is superuser in stored procedure?  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: Can I check if somebody is superuser in stored procedure?  (Pavel Stehule <pavel.stehule@gmail.com>)
Список pgsql-hackers
On Sun, Mar 27, 2011 at 03:21:18PM +0200, Pavel Stehule wrote:
> Hello
> 
> Is there some simple possibility to check a rights from stored procedure?

Well, there's the catalog lookup method:

SELECT EXISTS (SELECT 1 FROM pg_catalog.pg_roles WHERE rolname=$1 AND rolsuper)

Is that what you had in mind?

Cheers,
David.
-- 
David Fetter <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@gmail.com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate


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

Предыдущее
От: Simon Riggs
Дата:
Сообщение: Additional options for Sync Replication
Следующее
От: Greg Stark
Дата:
Сообщение: Re: Lock problem with autovacuum truncating heap