Re: [Proposal] Adding Log File Capability to pg_createsubscriber - Mailing list pgsql-hackers

From Gyan Sreejith
Subject Re: [Proposal] Adding Log File Capability to pg_createsubscriber
Date
Msg-id CAEqnbaU=EgqhxEx0ig4TdY8pdt0Vn+vmCJBuoORRHOzovW9dWA@mail.gmail.com
Whole thread
In response to RE: [Proposal] Adding Log File Capability to pg_createsubscriber  (Kuroda, Hayato/黒田 隼人 <kuroda.hayato@fujitsu.com>)
Responses Re: [Proposal] Adding Log File Capability to pg_createsubscriber
RE: [Proposal] Adding Log File Capability to pg_createsubscriber
List pgsql-hackers
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

Attachment

pgsql-hackers by date:

Previous
From: Jianghua Yang
Date:
Subject: Re: [PATCH] Fix fd leak in pg_dump compression backends when dup()+fdopen() fails
Next
From: Andrew Dunstan
Date:
Subject: pg_get__*_ddl consolidation