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

From Kuroda, Hayato/黒田 隼人
Subject RE: [Proposal] Adding Log File Capability to pg_createsubscriber
Date
Msg-id OSOPR01MB1215385EAC6A76650444E40B0F54FA@OSOPR01MB12153.jpnprd01.prod.outlook.com
Whole thread Raw
In response to RE: [Proposal] Adding Log File Capability to pg_createsubscriber  ("Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>)
Responses Re: [Proposal] Adding Log File Capability to pg_createsubscriber
List pgsql-hackers
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: David Rowley
Date:
Subject: Re: another autovacuum scheduling thread
Next
From: Chengxi Sun
Date:
Subject: Re: Add uuid_to_base32hex() and base32hex_to_uuid() built-in functions