RE: pg_ctl start may return 0 even if the postmaster has been already started on Windows
Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>
From: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
To: 'Kyotaro Horiguchi' <horikyota.ntt@gmail.com>
Cc: "shlok.kyal.oss@gmail.com" <shlok.kyal.oss@gmail.com>, "michael@paquier.xyz" <michael@paquier.xyz>, "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>
Date: 2023-10-24T07:37:22Z
Lists: pgsql-hackers
Dear Horiguchi-san,
Thanks for updates! I was quite not sure the Windows env, but I can post comments.
(We need reviews by windows-friendly developers...)
> Other error cases will fit to "shouldn't occur under normal
> conditions" errors.
Formatting of messages for write_stderr() seem different from others. In v3,
I slightly modified for readability like below. I wanted to let you know just in case
because you did not say anything about these changes...
```
+ /* create a process snapshot */
+ hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
+ if (hSnapshot == INVALID_HANDLE_VALUE)
+ {
+ write_stderr(_("%s: could not create a snapshot: error code %lu\n"),
+ progname, (unsigned long) GetLastError());
+ exit(1);
+ }
+
+ /* start iterating on the snapshot */
+ ppe.dwSize = sizeof(PROCESSENTRY32);
+ if (!Process32First(hSnapshot, &ppe))
+ {
+ write_stderr(_("%s: cound not retrieve information about the process: error code %lu\n"),
+ progname, GetLastError());
+ exit(1);
+ }
+
```
Best Regards,
Hayato Kuroda
FUJITSU LIMITED
Commits
-
Re-enable autoruns for cmd.exe on Windows
- 74b8e6a69802 18.0 landed
-
Re-enable autoruns for for cmd.exe on Windows
- fa1a63dffcd7 17.0 landed
-
pg_regress: Disable autoruns for cmd.exe on Windows
- e50a52b2b448 12.18 landed
- 2a0eb80ae4ad 13.14 landed
- 4a7475e9a332 14.11 landed
- 7e7d827f57b9 15.6 landed
- 506c77f9b2e5 16.2 landed
- b83747a8a65b 17.0 landed
-
pg_ctl: Disable autoruns for cmd.exe on Windows
- 9e70e6564fc8 12.18 landed
- c8aab699edd6 13.14 landed
- 4c6944223ef4 14.11 landed
- 33d1be06aee0 15.6 landed
- 714bfb7813ed 16.2 landed
- 9886744a361b 17.0 landed