Re: Add support for logging the current role

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, 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 02:52:34
Message-ID: 20110217025234.GN4116@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

* Robert Haas (robertmhaas(at)gmail(dot)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(at)snowman(dot)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(at)snowman(dot)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(at)snowman(dot)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.

Attachment Content-Type Size
logrole-20110216.patch text/x-diff 6.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2011-02-17 02:59:32 Re: Debian readline/libedit breakage
Previous Message Stephen Frost 2011-02-17 02:03:06 Re: Add support for logging the current role