checking if user is connected as a superuser?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

checking if user is connected as a superuser?

Dragan Matic
Is there a way to check if user is a superuser for the given cluster?
Thanks in advance

Dragan


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to [hidden email])
Reply | Threaded
Open this post in threaded view
|

Re: checking if user is connected as a superuser?

hubert depesz lubaczewski
On 6/6/05, Dragan Matic <[hidden email]> wrote:
Is there a way to check if user is a superuser for the given cluster?
Thanks in advance

select usesuper from pg_user where usename = CURRENT_USER;

depesz
Reply | Threaded
Open this post in threaded view
|

Re: checking if user is connected as a superuser?

Alvaro Herrera
In reply to this post by Dragan Matic
On Mon, Jun 06, 2005 at 12:21:56PM +0200, Dragan Matic wrote:
> Is there a way to check if user is a superuser for the given cluster?

alvherre=# show is_superuser;
 is_superuser
--------------
 on
(1 fila)

alvherre=# select current_setting('is_superuser');
 current_setting
-----------------
 on
(1 fila)


--
Alvaro Herrera (<alvherre[a]surnet.cl>)
La web junta la gente porque no importa que clase de mutante sexual seas,
tienes millones de posibles parejas. Pon "buscar gente que tengan sexo con
ciervos incendiándose", y el computador dirá "especifique el tipo de ciervo"
(Jason Alexander)

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq