RE: pg_ctl start may return 0 even if the postmaster has been already started on Windows

Поиск
Список
Период
Сортировка
От Hayato Kuroda (Fujitsu)
Тема RE: pg_ctl start may return 0 even if the postmaster has been already started on Windows
Дата
Msg-id TYAPR01MB5866E8D3942338637909743EF5EDA@TYAPR01MB5866.jpnprd01.prod.outlook.com
обсуждение исходный текст
Ответ на Re: pg_ctl start may return 0 even if the postmaster has been already started on Windows  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Ответы Re: pg_ctl start may return 0 even if the postmaster has been already started on Windows  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
Список pgsql-hackers
Dear Hoiguchi-san,

Thank you for making the patch!

> It doesn't seem to work as expected. We still lose the relationship
> between the PID file and the launched postmaster.

Yes, I did not expect that the relationship can be kept.
Conceptually +1 for your approach.

> > Ditching cmd.exe seems like a big hassle. So, on the flip side, I
> > tried to identify the postmaster PID using the shell's PID, and it
> > seem to work. The APIs used are avaiable from XP/2003 onwards.

According to 495ed0ef2, Windows 10 seems the minimal requirement for using
the postgres. So the approach seems OK.

Followings are my comment, but I can say only cosmetic ones because I do not have
windows machine which can run postgres.


1.
Forward declaration seems missing. In the pg_ctl.c, the static function seems to
be declared even if there is only one caller (c.f., GetPrivilegesToDelete).

2.
I think the argument should be pid_t.

3.
I'm not sure the return type of the function should be pid_t or not. According
to the document, DWORD corrresponds to the pid_t. In win32_port.h, the pid_t is
defiend as int (_MSC_VER seems to be defined when the VisualStduio is used). It
is harmless, but I perfer to match the interface between caller/callee. IIUC we
can add just a cast.

```
#ifdef _MSC_VER
typedef int pid_t;
#endif
```

Best Regards,
Hayato Kuroda
FUJITSU LIMITED




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Dilip Kumar
Дата:
Сообщение: Re: CHECK Constraint Deferrable
Следующее
От: Daniel Gustafsson
Дата:
Сообщение: Re: Build the docs if there are changes in docs and don't run other tasks if the changes are only in docs