From: Bruce Momjian <bruce@momjian.us>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Adrian Klaver <adrian.klaver@aklaver.com>
Cc: Mladen Gogala <gogala.mladen@gmail.com>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: log_statement GUC parameter
Date: Thu, 12 Aug 2021 16:40:07 -0400
Message-ID: <20210812204007.GC4822@momjian.us> (raw)
In-Reply-To: <4105997.1628800636@sss.pgh.pa.us>
References: <510207d8-8895-c3cb-e0a1-55135e4ce4f7@gmail.com>
<e9ab9151-6f4d-e7bf-d5d5-0ec3d06695cf@aklaver.com>
<4105997.1628800636@sss.pgh.pa.us>
On Thu, Aug 12, 2021 at 04:37:16PM -0400, Tom Lane wrote:
> [ dept. of second thoughts ]
>
> Adrian Klaver <adrian.klaver@aklaver.com> writes:
> > On 8/12/21 1:19 PM, Mladen Gogala wrote:
> >> The idea is to log all statements by the particular user, not by
> >> everybody.
>
> > Would pg_stat_statements work for you?:
> > https://www.postgresql.org/docs/current/pgstatstatements.html
>
> Actually, for that specific requirement, there's an easier way:
>
> ALTER USER target_user SET log_statement = 'all';
>
> While the target_user can't do that for himself, a superuser
> can.
Ah, yes, I hadn't considered that ALTER USER bypasses those user checks.
--
Bruce Momjian <bruce@momjian.us> https://momjian.us
EDB https://enterprisedb.com
If only the physical world exists, free will is an illusion.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: bruce@momjian.us, tgl@sss.pgh.pa.us, adrian.klaver@aklaver.com, gogala.mladen@gmail.com
Subject: Re: log_statement GUC parameter
In-Reply-To: <20210812204007.GC4822@momjian.us>
References: <510207d8-8895-c3cb-e0a1-55135e4ce4f7@gmail.com> <e9ab9151-6f4d-e7bf-d5d5-0ec3d06695cf@aklaver.com> <4105997.1628800636@sss.pgh.pa.us> <20210812204007.GC4822@momjian.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox