Re: User specific log file in Postgres

From: Daulat <daulat(dot)dba(at)gmail(dot)com>
To: Dan Smith <j(dot)daniel(dot)smith1(at)gmail(dot)com>
Cc: pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: User specific log file in Postgres
Date: 2021-11-24 08:50:40
Message-ID: CALfOM6JpBMQG_b2CK=i=n_bNi-RpdXzM0ZfYLoGj6+AGQRO7XQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Thanks Dan Smith,
Will it log queries executed from PGADMIN? I think no.

Regards,

On Wed, Nov 24, 2021 at 12:45 AM Dan Smith <j(dot)daniel(dot)smith1(at)gmail(dot)com>
wrote:

> Here are a couple of ideas that are outside of the direct question.
>
> I believe you can target one or more users with the pgaudit extension.
> Look for Session Audit Logging.
> Example "ALTER ROLE role_name SET pgaudit.log = 'all, -misc';".
> https://github.com/pgaudit/pgaudit#session-audit-logging
>
> Some clients such as psql will also allow you to write history per host /
> user. ~/.psqlrc file add "\set HISTFILE ~/.psql_history_ :HOST _ :USER _
> :DBNAME" for example.
>
> Both of these should be well documented and relatively easy to test to see
> if they might be of some assistance for you.
>
> Hope this helps.
>
>
> Best regards,
>
> Dan Smith
>
> On Tue, Nov 23, 2021, 04:52 Michel SALAIS <msalais(at)msym(dot)fr> wrote:
>
>> Hi,
>>
>>
>>
>> If you mean the “standard” logging system for PostgreSQL the reply is No.
>> Parameter “log_filename” is of context “sighup” and can’t be modified by
>> session…
>>
>>
>>
>> *Michel SALAIS*
>>
>> *Consultant Oracle, PostgreSQL*
>>
>> *MSYM*
>>
>> *23 rue du Départ*
>>
>> *Boîte 37*
>>
>> *75014 Paris*
>>
>>
>>
>> *+33 6 68 94 19 60*
>>
>> *msalais(at)msym(dot)fr <msalais(at)msym(dot)fr>*
>>
>> *www.msym.fr <http://www.msym.fr/>*
>>
>>
>>
>> *De :* Daulat <daulat(dot)dba(at)gmail(dot)com>
>> *Envoyé :* mardi 23 novembre 2021 12:54
>> *À :* pgsql-admin(at)lists(dot)postgresql(dot)org
>> *Objet :* User specific log file in Postgres
>>
>>
>>
>> Hello Team,
>>
>>
>>
>> Is it possible to set up individual logging files for specific users in
>> Postgresql?
>>
>>
>>
>> Please suggest !
>>
>>
>>
>> Thanks
>>
>>
>>
>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Firthouse banu 2021-11-24 09:18:07
Previous Message Dan Smith 2021-11-23 19:14:41 Re: User specific log file in Postgres