Re: Feature request: separate logging

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
Cc: otheus uibk <otheus(dot)uibk(at)gmail(dot)com>, PostgreSQL General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Feature request: separate logging
Date: 2016-11-21 01:09:54
Message-ID: CAB7nPqTu7PDmkJ-0-RuW=TWq6gGML2Tr+OT=9mvtHjrrucsycA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, Nov 20, 2016 at 12:56 PM, Guillaume Lelarge
<guillaume(at)lelarge(dot)info> wrote:
> Le 18 nov. 2016 2:03 PM, "otheus uibk" <otheus(dot)uibk(at)gmail(dot)com> a écrit :
>> Finally, if these changes can be implemented, is it impossible to backport
>> them to prior versions, say 9.1 and up? If I wrote a patch, under what
>> conditions would the patch be accepted for inclusion in official releases of
>> older versions?
>>
>
> Only bug fixes are accepted in older releases. What you're proposing isn't a
> bug fix.

To put it in other words, if you are willing to write a patch that
would be accepted by upstream, the first version where it could land
is Postgres 10. Currently this version is still in development and the
last commit fest will be in March. See more details here:
https://wiki.postgresql.org/wiki/Submitting_a_Patch

If you are willing to get something done in older versions, it may be
interesting to look at the hook in elog.c and try to implement what
you are looking for as plugin loaded by the server at startup using
shared_preload_libraries. Reading roughly what you are writing above,
I guess that it could be possible: the elog hook offers ways to
redirect message strings generated by the server the way you want.

I wrote such a thing some time ago to generate logs with a JSON
format, you may want to look at that to give you more ideas:
https://github.com/michaelpq/pg_plugins/tree/master/jsonlog
--
Michael

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Subhankar Chattopadhyay 2016-11-21 05:29:53 pg_basebackup on slave running for a long time
Previous Message Tom Lane 2016-11-20 19:37:41 Re: Strict min and max aggregate functions