Re: Can I check if somebody is superuser in stored procedure? - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: Can I check if somebody is superuser in stored procedure?
Date
Msg-id AANLkTi=X297bB2GwaW4hPREd3+DZsfXSxxjjyrTYW3Sm@mail.gmail.com
Whole thread Raw
In response to Re: Can I check if somebody is superuser in stored procedure?  (David Fetter <david@fetter.org>)
Responses Re: Can I check if somebody is superuser in stored procedure?
List pgsql-hackers
Hello

2011/3/28 David Fetter <david@fetter.org>:
> 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?

I found this too, but it isn't what I searched - I searched a some
exported function based on internal cache.

For my purpose is this solution enough.

Regards

Pavel

>
> 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 by date:

Previous
From: Guillaume Lelarge
Date:
Subject: Re: GSoC 2011 - Mentors? Projects?
Next
From: Vaibhav Kaushal
Date:
Subject: ExecEvalVar does not have appropriate ExprState?