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.paqu...@gmail.com> wrote: > On Wed, Jun 22, 2016 at 2:02 AM, Alvaro Herrera > <alvhe...@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
external_pid_file.patch
Description: Binary data
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers