Re: Add support for logging the current role

Stephen Frost <sfrost@snowman.net>

From: Stephen Frost <sfrost@snowman.net>
To: Robert Haas <robertmhaas@gmail.com>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Andrew Dunstan <andrew@dunslane.net>, Itagaki Takahiro <itagaki.takahiro@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2011-02-17T02:52:34Z
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

Attachments

* Robert Haas (robertmhaas@gmail.com) wrote:
> Ah, so it does.  Sounds like you win.  Have we a patch implementing
> the sounds-like-its-agreed change, then?

Patch attached, rebased to current master.  Full git log:

	Thanks,

		Stephen

commit 47eebe20deb5da56ea6eb413ee80110887790440
Author: Stephen Frost <sfrost@snowman.net>
Date:   Wed Feb 16 21:42:14 2011 -0500

    Add current role to csvlog output
    
    This patch adds the current role to the csvlog output.  It also slightly
    changes the user_name column to return the session user, if it's been
    changed from the login user, instead of the original login user.
    This is only possible through SET SESSION AUTHORIZATION, which is only
    allowed for superusers.  These changes allow a clear view of what
    privileges commands are being run as.

commit 7456d4fc98e6207b562dd0325dc09bbb1c915ae9
Merge: c1b06c0 9301698
Author: Stephen Frost <sfrost@snowman.net>
Date:   Wed Feb 16 21:03:59 2011 -0500

    Merge branch 'master' of git://git.postgresql.org/git/postgresql into log_role_basic

commit c1b06c04af0c886c6ec27917368f3c674227ed2d
Author: Stephen Frost <sfrost@snowman.net>
Date:   Tue Feb 15 10:21:38 2011 -0500

    Add %U option to log_line_prefix
    
    This patch adds a %U option to log_line_prefix, to allow logging
    of the current role (previously not possible).  Also reworks %u
    a bit and adds documentation to clarify what each means.