Re: log_statement GUC parameter

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: Mladen Gogala <gogala(dot)mladen(at)gmail(dot)com>, pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: log_statement GUC parameter
Date: 2021-08-12 20:37:16
Message-ID: 4105997.1628800636@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

[ dept. of second thoughts ]

Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2021-08-12 20:40:07 Re: log_statement GUC parameter
Previous Message Bruce Momjian 2021-08-12 20:31:17 Re: log_statement GUC parameter