Re: replication commands and log_statements

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Bruce Momjian <bruce(at)momjian(dot)us>, Abhijit Menon-Sen <ams(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, Stephen Frost <sfrost(at)snowman(dot)net>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Magnus Hagander <magnus(at)hagander(dot)net>
Subject: Re: replication commands and log_statements
Date: 2014-08-12 03:59:31
Message-ID: CAHGQGwEa+0WtNsm6g7xKO-FmX1GVLswLDgRu_pCUzXfYp7Y4nw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Aug 12, 2014 at 2:34 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Fri, Aug 8, 2014 at 1:04 PM, Fujii Masao <masao(dot)fujii(at)gmail(dot)com> wrote:
>> On Sat, Aug 9, 2014 at 12:29 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>>> On Fri, Aug 8, 2014 at 11:00 AM, Bruce Momjian <bruce(at)momjian(dot)us> wrote:
>>>> On Fri, Aug 8, 2014 at 08:51:13AM -0400, Robert Haas wrote:
>>>>> On Thu, Aug 7, 2014 at 12:07 PM, Abhijit Menon-Sen <ams(at)2ndquadrant(dot)com> wrote:
>>>>> > At 2014-08-07 23:22:43 +0900, masao(dot)fujii(at)gmail(dot)com wrote:
>>>>> >> That is, we log replication commands only when log_statement is set to
>>>>> >> all. Neither new parameter is introduced nor log_statement is
>>>>> >> redefined as a list.
>>>>> >
>>>>> > That sounds good to me.
>>>>>
>>>>> It sounds fairly unprincipled to me. I liked the idea of making
>>>>> log_statement a list, but if we aren't gonna do that, I think this
>>>>> should be a separate parameter.
>>>>
>>>> I am unclear there is enough demand for a separate replication logging
>>>> parameter --- using log_statement=all made sense to me.
>>>
>>> Most people don't want to turn on log_statement=all because it
>>> produces too much log volume.
>>>
>>> See, for example:
>>> http://bonesmoses.org/2014/08/05/on-postgresql-logging-verbosity/
>>>
>>> But logging replication commands is quite low-volume, so it is not
>>> hard to imagine someone wanting to log all replication commands but
>>> not all SQL statements.
>>
>> You can do that by executing
>> "ALTER ROLE <replication user> SET log_statement TO 'all'".
>> If you don't use the replication user to execute SQL statements,
>> no SQL statements are logged in that setting.
>
> If you have a user devoted to it, I suppose that's true. I still
> think it shouldn't get munged together like that.

Why do we need to treat only replication commands as special ones and
add new parameter to display them? I agree to add new parameter like
log_replication to log the replication activity instead of the command
itself, like checkpoint activity which can be enabled by log_checkpoints.
But I'm not sure why logging of replication commands also needs to be
controlled by separate parameter.

And, I still think that those who set log_statement to all expect that all
the commands including replication commands are logged. I'm afraid
that separating only parameter for replication commands might confuse
the users.

Regards,

--
Fujii Masao

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2014-08-12 04:23:35 Re: postgresql.auto.conf and reload
Previous Message Pavel Stehule 2014-08-12 03:18:11 Re: psql: show only failed queries