Re: log_autovacuum_min_duration doesn't log VACUUMs

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: log_autovacuum_min_duration doesn't log VACUUMs
Date: 2017-02-13 17:12:35
Message-ID: CA+TgmobVa52brgj60n-DgVrwP26fZG=VzgKjpENS4WCuWaVU6Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Feb 12, 2017 at 9:20 PM, Jim Nasby <Jim(dot)Nasby(at)bluetreble(dot)com> wrote:
> On 2/10/17 2:33 PM, Robert Haas wrote:
>> That having been said, I think it could certainly be useful to have
>> more control over what DDL gets logged in foreground processes.
>
> FWIW, this is a significant problem outside of DDL. Once you're past 1-2
> levels of nesting SET client_min_messages = DEBUG becomes completely
> useless.
>
> I think the ability to filter logging based on context would be very
> valuable. AFAIK you could actually do that for manual logging with existing
> plpgsql support, but obviously that won't help for anything else.

Well, that's moving the goalposts a lot further and in an unrelated
direction. I don't think that it's a good idea to change the
semantics of log_autovacuum_min_duration in the way Simon is proposing
for the reasons I noted, but I think that an acceptable patch could be
100 lines of pretty straightforward code and documentation, like a new
GUC that controls this output for the vac-non-autovac case.
Fine-grained control over which commands get logged in general is
harder, but it's still only a moderately complex patch (I think).
Filtering based on the context in which the logging is happening
sounds extremely complicated; I'm not sure what sort of design for
that would even be reasonable and it seems like there might be
innumerable requests for additional frammishes culminating in some
sort of mini-language and getting committed right around the time
Zefram Cochrane makes his inaugural flight.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2017-02-13 17:14:20 Re: COPY IN/BOTH vs. extended query mode
Previous Message Fujii Masao 2017-02-13 17:07:55 Re: Provide list of subscriptions and publications in psql's completion