From: Tom Lane <tgl@sss.pgh.pa.us>
To: 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:37:16 -0400
Message-ID: <4105997.1628800636@sss.pgh.pa.us> (raw)
In-Reply-To: <e9ab9151-6f4d-e7bf-d5d5-0ec3d06695cf@aklaver.com>
References: <510207d8-8895-c3cb-e0a1-55135e4ce4f7@gmail.com>
<e9ab9151-6f4d-e7bf-d5d5-0ec3d06695cf@aklaver.com>
[ 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.
regards, tom lane
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: tgl@sss.pgh.pa.us, adrian.klaver@aklaver.com, gogala.mladen@gmail.com
Subject: Re: log_statement GUC parameter
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>
* 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