Re: Add support for logging the current role

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stephen Frost <sfrost(at)snowman(dot)net>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add support for logging the current role
Date: 2011-02-17 16:10:35
Message-ID: 8409.1297959035@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Stephen Frost <sfrost(at)snowman(dot)net> writes:
> * Tom Lane (tgl(at)sss(dot)pgh(dot)pa(dot)us) wrote:
>> Yeah, I thought what was supposed to be emitted was the value of
>> current_user, not SQL's weird definition of what SET ROLE means.

> current_user uses GetUserNameFromId() and goes through the cache lookups
> to get there. I was using what show_role() returns (which is also what
> 'show role;' returns). I'd be happy to make it emit an empty string
> when 'none' is returned though.

Well, that just doesn't seem useful to me in the real world. If I were
using this, I would expect it to emit a real user name that matches the
currently applied permissions checking. All the time. "show role" does
what it does because the SQL standard says so, not because anybody
outside the standards committee thinks that's a sane definition.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2011-02-17 16:18:23 Re: Re: [COMMITTERS] pgsql: Fix blatantly uninitialized variable in recent commit.
Previous Message Tom Lane 2011-02-17 16:03:15 Re: ALTER EXTENSION UPGRADE, v3