Re: Requesting external_pid_file with postgres -C when not initialized lead to coredump

Поиск
Список
Период
Сортировка
От alain radix
Тема Re: Requesting external_pid_file with postgres -C when not initialized lead to coredump
Дата
Msg-id CA+YdpwxPUADrmxSD7+Td=uOshMB1KkDN7G7cf+FGmNjjxMhjbw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Requesting external_pid_file with postgres -C when not initialized lead to coredump  (Michael Paquier <michael.paquier@gmail.com>)
Ответы Re: Requesting external_pid_file with postgres -C when not initialized lead to coredump  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Yes Michael,
 
You're right, I aw this yesterday but couldn't make a patch.

Here is a new patch with postmaster.c modification so that it check about a empty string instead of a null pointer.

The meaning is no more to avoid a core dump as you've done a change for that but to have the same result with postgres -C as with a request to pg_settings, an empty string when the parameter is not set.

It seems a lot better to me that different ways to request the same parameter should return the same answer.

Actually, setting from a request to pg_settings an empty string in postgresql.conf for external_pid_file would lead to an error for the postmaster.

To values of parameter should be the same reported in pg_settings and postgres -C and should be a valid settings in postgresql.conf
So, that if you create a postgresql.conf from pg_settings or postresql -C,, it would would be a valid one.

So, the patch make an empty string valid in all places and shouldn't cause problem with existing installations.

Regards.


Alain Radix

On 21 June 2016 at 23:45, Michael Paquier <michael.paquier@gmail.com> wrote:
On Wed, Jun 22, 2016 at 2:02 AM, Alvaro Herrera
<alvherre@2ndquadrant.com> wrote:
> alain radix wrote:
>> So, here is my first patch for PostgreSQL.
>
> Looking forward to further ones,

A comment on this patch: this is an incorrect approach anyway.
PostmasterMain relies on this value being NULL to decide if this PID
file should be written or not, so this patch applied as-is would
result in a message outputted to stderr if the logic is not changed
there.
--
Michael



--
Alain Radix
Вложения

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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Hash Indexes
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Hash Indexes