Re: [Proposal] Adding Log File Capability to pg_createsubscriber

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, Gyan Sreejith <gyan(dot)sreejith(at)gmail(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>, shveta malik <shveta(dot)malik(at)gmail(dot)com>, Shlok Kyal <shlok(dot)kyal(dot)oss(at)gmail(dot)com>, vignesh C <vignesh21(at)gmail(dot)com>, Euler Taveira <euler(at)eulerto(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: [Proposal] Adding Log File Capability to pg_createsubscriber
Date: 2026-04-13 09:24:14
Message-ID: 0485e0b3-b0ec-4f36-8b61-99692b71990c@eisentraut.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 08.04.26 07:30, Amit Kapila wrote:
> On Tue, Apr 7, 2026 at 7:07 PM Peter Eisentraut <peter(at)eisentraut(dot)org> wrote:
>>
>> On 01.04.26 07:05, Hayato Kuroda (Fujitsu) wrote:
>>> Dear Peter E.,
>>>
>>>> Instead of creating a new logging API in pg_createsubscriber locally,
>>>> why not extend logging.c to support a log file.
>>>
>>> I had a concern to extend the common module. Do you have possible idea to use
>>> pg_logging_set_logfile() on others? I cannot, tee command on linux seems enough
>>> for others.
>>
>> pg_upgrade was mentioned.
>>
>
> I see that pg_upgrade has some specific requirements related to
> verbose/status/report kind of messages which doesn't seem to be
> directly handled by the generic API pg_log_generic(). For example,
> apart from other things, we need to unset/reset log_file when we want
> to send messages only to the terminal and quite some specific handling
> for status or other kinds of messages. If you think pg_log_generic
> could be extended to handle various upgrade cases then I think it
> would be a good use case for it and we should go-ahead with what you
> are proposing. OTOH, maybe we can give it a separate try and use the
> resulting API for both pg_createsubscriber and pg_upgrade. I am fine
> either way you would like to go-ahead with this.

I have committed these patches.

I would like to apply the frontend logging API to pg_upgrade as well,
but that's a bigger project for not right now.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Chao Li 2026-04-13 09:28:51 Re: quoteOneName() inconsistency with quote_all_identifiers — replacement API proposed
Previous Message SATYANARAYANA NARLAPURAM 2026-04-13 09:21:28 Bug: COPY FORMAT JSON includes generated columns unlike text/CSV