Re: Set a specific database to log_statement='ddl' but others to be log_statement='all' - Mailing list pgsql-general

From David G. Johnston
Subject Re: Set a specific database to log_statement='ddl' but others to be log_statement='all'
Date
Msg-id CAKFQuwYe445E=T0fWFkTuv3GiDZ+yXX_OT9YPJMZ40kTOimQdg@mail.gmail.com
Whole thread Raw
In response to Set a specific database to log_statement='ddl' but others to be log_statement='all'  (Abdul Qoyyuum <aqoyyuum@cardaccess.com.au>)
Responses Re: Set a specific database to log_statement='ddl' but others to be log_statement='all'
List pgsql-general
On Monday, February 15, 2021, Abdul Qoyyuum <aqoyyuum@cardaccess.com.au> wrote:
Hi all,

I have a Postgresql cluster with master and multiple slaves running on version 9.6. I'm trying to adjust the log_statement from all to ddl on specific databases (i.e. postgresql.conf has log_statement='all' but I need a couple of databases set to log_statement='ddl').

etx_ecom=# ALTER DATABASE etx_ecom SET log_statement='ddl';
ALTER DATABASE
etx_ecom=# show log_statement;
 log_statement
---------------
 all
(1 row)

etx_ecom=# INSERT into card_type VALUES('Q','TEST');
INSERT 0 1

etx_ecom=#  

Feb 16 10:56:11 db1 postgres[21682]: [3602-1] <myusername@[local]->etx_ecom> LOG:  statement: INSERT into card_type VALUES('Q','TEST');

Why doesn't the Alter Database work?


It did - you just didn’t start a new session as the documentation directs.  You only altered a default that is only considered during user sign-in.

David J.

pgsql-general by date:

Previous
From: David Rowley
Date:
Subject: Re: Why is Postgres only using 8 cores for partitioned count? [Parallel Append]
Next
From: Laurenz Albe
Date:
Subject: Re: MultiXactMemberControlLock contention on a replica