Re: [bug fix] pg_ctl always uses the same event source - Mailing list pgsql-hackers

From MauMau
Subject Re: [bug fix] pg_ctl always uses the same event source
Date
Msg-id 8192627E48244905AD6E16C1DAD39CD5@maumau
Whole thread Raw
In response to Re: [bug fix] pg_ctl always uses the same event source  (Amit Kapila <amit.kapila16@gmail.com>)
Responses Re: [bug fix] pg_ctl always uses the same event source
List pgsql-hackers
>> From: "Amit Kapila" <amit.kapila16@gmail.com>
>   I think it is better to keep it like what I suggested above,
> because in that case
>   it will assign default name even if postgres -C fails due to some 
> reason.
>
>>> 2. What will happen if user doesn't change the name in "event_source"
>>> or kept the same name,
>>>    won't it hit the same problem again? So shouldn't it try to
>>> generate different name by appending
>>>    version string to it?
>>

I re-considered that.  As you suggested, I think I'll do as follows.  Would 
this be OK?

[pg_ctl.c]
evtHandle = RegisterEventSource(NULL, *event_source ? event_source :   "PostgreSQL " PG_MAJORVERSION);


[guc.c]
{"event_source", PGC_POSTMASTER, LOGGING_WHERE,
...
"PostgreSQL " PG_MAJORVERSION,
NULL, NULL, NULL



[elog.c]
Writing the default value in this file was redundant, because event_source 
cannot be NULL.  So change

evtHandle = RegisterEventSource(NULL, event_source ? event_source : 
"PostgreSQL");

to

evtHandle = RegisterEventSource(NULL, event_source);


Regards
MauMau





pgsql-hackers by date:

Previous
From: Kevin Grittner
Date:
Subject: Re: Why the buildfarm is all pink
Next
From: Tom Lane
Date:
Subject: Re: Why the buildfarm is all pink