pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
How to determine the current user
2+ messages / 2 participants
[nested] [flat]

* How to determine the current user
@ 2003-10-14 18:05 Michael Brusser <michael@synchronicity.com>
  2003-10-14 19:14 ` Re: How to determine the current user Sean Chittenden <sean@chittenden.org>
  0 siblings, 1 reply; 2+ messages in thread

From: Michael Brusser @ 2003-10-14 18:05 UTC (permalink / raw)
  To: pgsql-sql

I'm running Pg v7.3.4 
I have a function where I need to determine the current user.
But since the function was created with option "SECURITY DEFINER" 
(it has to be this way) current_user returns the name of creator,
rather than current user.

Is there a way in such function find out the real current user?

Thanks,
Mike.






^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: How to determine the current user
  2003-10-14 18:05 How to determine the current user Michael Brusser <michael@synchronicity.com>
@ 2003-10-14 19:14 ` Sean Chittenden <sean@chittenden.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Sean Chittenden @ 2003-10-14 19:14 UTC (permalink / raw)
  To: Michael Brusser <michael@synchronicity.com>; +Cc: pgsql-sql

> I'm running Pg v7.3.4 
> I have a function where I need to determine the current user.
> But since the function was created with option "SECURITY DEFINER" 
> (it has to be this way) current_user returns the name of creator,
> rather than current user.
> 
> Is there a way in such function find out the real current user?

CURRENT_USER should be right.  SESSION_USER is the username that
connected to the DB.  Look at table 6-27, session information
functions:

http://www.postgresql.org/docs/7.3/static/functions-misc.html

-sc

-- 
Sean Chittenden



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2003-10-14 19:14 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-10-14 18:05 How to determine the current user Michael Brusser <michael@synchronicity.com>
2003-10-14 19:14 ` Sean Chittenden <sean@chittenden.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox