Re: Identify Login User & Permissions

From: Richard Broersma <richard(dot)broersma(at)gmail(dot)com>
To: Carlos Mennens <carlos(dot)mennens(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Identify Login User & Permissions
Date: 2010-09-14 20:32:40
Message-ID: AANLkTikbejmLxT0ajAGRaouU2+tUYmjjkOVFgZ-c3YCp@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Sep 14, 2010 at 1:01 PM, Carlos Mennens
<carlos(dot)mennens(at)gmail(dot)com> wrote:
> I can't find in the docs or using Google how one can identify which
> user is currently logged in to psql. I search for the command that if
> for some reason I forget which user I am logged in as, rather than
> logging out of PostgreSQL, there has to be a command that shows me who
> I am and also what kind of special permissions my current user has.
> Can anyone please assist me or point me in the right direction?

I don't have the entire answer. But here is a place to start:

http://www.postgresql.org/docs/9.0/static/functions-info.html

Note that there is a slight distinction between current_user and session_user.

postgres=> select user, current_user, session_user;
current_user | current_user | session_user
--------------+--------------+--------------
broersr | broersr | broersr
(1 row)

--
Regards,
Richard Broersma Jr.

Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Richard Broersma 2010-09-14 21:08:17 Re: Identify Login User & Permissions
Previous Message Carlos Mennens 2010-09-14 20:28:23 Re: Identify Login User & Permissions