Re: Add support for logging the current role

Stephen Frost <sfrost@snowman.net>

From: Stephen Frost <sfrost@snowman.net>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Robert Haas <robertmhaas@gmail.com>, Andrew Dunstan <andrew@dunslane.net>, Itagaki Takahiro <itagaki.takahiro@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2011-02-17T15:58:11Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Add support for an application_name parameter, which is displayed in

  2. Make CSV column ordering a bit more logical.

  3. Extend the format of CSV logs to include the additional information supplied

  4. Add virtual transaction IDs to CSVLOG output, so that messages coming from

  5. Provide for logfiles in machine readable CSV format. In consequence, rename

* Tom Lane (tgl@sss.pgh.pa.us) wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
> > Ugg, wait a minute.  This not only adds %U; it also changes the
> > behavior of %u, which I don't think we've agreed on.  Also, emitting
> > 'none' when not SET ROLE has been done is pretty ugly.  I'm back to
> > thinking we need to push this out to 9.2 and take more time to think
> > about this.
> 
> 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.

	Thanks,

		Stephen