Re: Add support for logging the current role

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Stephen Frost <sfrost(at)snowman(dot)net>, 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-18 13:32:35
Message-ID: AANLkTikQASbvjyE536Fz2zYGtEOEN5qath=CQgxMu9BF@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Feb 17, 2011 at 10:40 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> On Thu, Feb 17, 2011 at 4:53 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>>> In short, add a bit of overhead at SetUserId time in order to make this
>>> cheap (and accurate) in elog.c.
>
>> As Stephen says, I think this is utterly impractical; those routines
>> can't ever throw any kind of error.
>
> Why would they need to throw an error?  It'd be on the caller's head to
> supply the role name along with OID.  We can keep the name in a static
> buffer of size NAMEDATALEN, so don't tell me about palloc failures
> either.

OK, but there are not a small number of callers of that function, and
they don't necessarily have the correct info at hand. For example,
you'd need to add prevUserAsText to TransactionStateData, which
doesn't seem appealing.

> The logging design as it stands seems to me to be a Rube Goldberg device
> that is probably going to have corner-case bugs quite aside from its
> possible performance issues.

I think you're overreacting.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2011-02-18 13:34:43 Re: WIP - Add ability to constrain backend temporary file space
Previous Message Robert Haas 2011-02-18 13:28:58 Re: contrib loose ends: 9.0 to 9.1 incompatibilities