Re: [bug fix] pg_ctl always uses the same event source

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: MauMau <maumau307(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [bug fix] pg_ctl always uses the same event source
Date: 2014-01-29 05:04:12
Message-ID: CAA4eK1LAg6ndZdWLb5e=Ep5DzcE8KZU=JbmO+tFwySYHm2ja=Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Jan 24, 2014 at 4:38 PM, MauMau <maumau307(at)gmail(dot)com> wrote:
>

>> How about below message:
>>
>> event source "<event_source_name>" is already registered.

>> OK, I added several lines for this. Please check the attached patch.

It gives the proper message, but even after error, the second message
box it shows "DLLInstall ... succeeded." I think the reason is that caller
of function DllRegisterServer() doesn't check the return value.

+ char message[1024];

why you have kept message as a global buffer, can't we just declare locally
inside the function?

>> What I had in mind was to change it during initdb, we are already doing it
>> for some other parameter (unix_socket_directories), please refer below
>> code in initdb.c
> Yes, It seems we can do this. However, could you forgive me for leaving this untouched? I'm afraid postgresql.conf.sample's issue is causing
> unnecessary war among people here. That doesn't affect the point of this patch --- make pg_ctl use the event_source setting. Anyway, not all
> parameters in postgresql.conf cannot be used just by uncommenting them. That's another issue.

Okay, I think we can leave it and also remove it from other parts of patch.
Although I found it is the right way, but Tom is not convinced with the idea,
so lets keep the Default event source name handling as it is.

As suggested by Tom, please update documentation.
"> Possibly there's room for a documentation patch reminding users to
> make sure that event_source is set appropriately before they turn
> on eventlog."
I think right place to update this information is where we are explaining
about setting of event log i.e at below link or may be if you find some other
better place:
http://www.postgresql.org/docs/devel/static/runtime-config-logging.html#GUC-LOG-DESTINATION

With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2014-01-29 05:04:51 Re: ALTER TABLE lock strength reduction patch is unsafe
Previous Message Robert Haas 2014-01-29 04:42:10 Re: Add force option to dropdb