Re: How to get current user

From: Terry Lee Tucker <terry(at)esc1(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: How to get current user
Date: 2004-11-16 21:18:13
Message-ID: 200411161618.13451.terry@esc1.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

This works for me:
SELECT INTO peopleRec log_name, position FROM people
WHERE lower(log_name) = lower(current_user);

On Tuesday 16 November 2004 03:28 pm, Guillermo saith:
> Hi,
>
> How can I get in a PL/pgSQL function, the current user name? I want to
> restrict updating a field if the user is not a Superuser.
>
> Thanx,
> Guillermo
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly

--
Quote: 26
"To those who cite the First Amendment as reason for excluding God from
more and more of our institutions everyday; I say: The First Amendment
of the Constitution was not written to protect the people of this country
from religious values; it was written to protect religious values from
government tyranny."

--Ronald Reagan

Work: 1-336-372-6812
Cell: 1-336-363-4719
email: terry(at)esc1(dot)com

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message sarlav kumar 2004-11-16 22:38:35 Index scan problem
Previous Message Guillermo 2004-11-16 20:28:14 How to get current user