Re: log_statement GUC parameter

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, 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:40:07
Message-ID: 20210812204007.GC4822@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Aug 12, 2021 at 04:37:16PM -0400, Tom Lane wrote:
> [ 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.

Ah, yes, I hadn't considered that ALTER USER bypasses those user checks.

--
Bruce Momjian <bruce(at)momjian(dot)us> https://momjian.us
EDB https://enterprisedb.com

If only the physical world exists, free will is an illusion.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Mladen Gogala 2021-08-12 20:49:00 Re: log_statement GUC parameter
Previous Message Tom Lane 2021-08-12 20:37:16 Re: log_statement GUC parameter