Re: [Proposal] Adding Log File Capability to pg_createsubscriber
Gyan Sreejith <gyan.sreejith@gmail.com>
From: Gyan Sreejith <gyan.sreejith@gmail.com>
To: Kuroda, Hayato/黒田 隼人 <kuroda.hayato@fujitsu.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>,
Shlok Kyal <shlok.kyal.oss@gmail.com>, vignesh C <vignesh21@gmail.com>, Euler Taveira <euler@eulerto.com>, "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>,
Peter Smith <smithpb2250@gmail.com>
Date: 2026-03-19T18:29:38Z
Lists: pgsql-hackers
Attachments
- v13-0003-Address-comments-from-Hayato-Kuroda.patch (application/octet-stream) patch v13-0003
- v13-0002-Add-a-new-argument-l-logdir-to-pg_createsubscrib.patch (application/octet-stream) patch v13-0002
- v13-0001-pg_createsubscriber-use-own-reporting-functions.patch (application/octet-stream) patch v13-0001
Thank you, Kuroda-san, for all the work.
I have made a small change - I added a pg_free() to free internal_log_file.
Regards,
Gyan
On Thu, Mar 19, 2026 at 7:55 AM Kuroda, Hayato/黒田 隼人 <
kuroda.hayato@fujitsu.com> wrote:
> Hi,
>
> While checking again, I found an issue in the new logging function - same
> va_list
> is used twice, but it was the undefined behavior. va_copy() is used to fix
> the issue.
>
> Also, below points were found and fixed in 0003. Thanks Peter Smith to
> work on.
>
> ```
> + printf(_(" -l, --logdir=LOGDIR location for the new
> log directory\n"));
> ```
>
> But there is a possibility that existing directory is specified, right?
>
> ```
> +my $logdir = PostgreSQL::Test::Utils::tempdir + "/logdir";
> ```
>
> Isn't it enough to just use tempdir here? At least, I think using "+" is
> not
> appropriate, "." is used to connect strings.
>
> ```
> + if (opt->log_dir != NULL)
> + appendPQExpBuffer(pg_ctl_cmd, " -l %s/%s/%s.log",
> opt->log_dir, log_timestamp, SERVER_LOG_FILE_NAME);
> ```
>
> I do not have 100% confident, but do we have to quote the logfile here?
>
> Best regards,
> Hayato Kuroda
> FUJITSU LIMITED
>
>
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
pg_createsubscriber: Don't use MAXPGPATH
- 99b726ac4894 19 (unreleased) landed
-
pg_createsubscriber: Remove separate logfile_open() function
- f5528b90b411 19 (unreleased) landed
-
pg_createsubscriber: Use logging.c log file callback
- 847336ba53af 19 (unreleased) landed
-
Add log file support to logging.c
- 41237556f8c5 19 (unreleased) landed
-
pg_createsubscriber: Add -l/--logdir option to redirect output to files.
- 6b5b7eae3ae6 19 (unreleased) landed
-
pg_createsubscriber: Introduce module-specific logging functions.
- d6628a5ea0a5 19 (unreleased) landed
-
Fix another buglet in archive_waldump.c.
- 69c57466a752 19 (unreleased) cited