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

From: "MauMau" <maumau307(at)gmail(dot)com>
To: "Amit Kapila" <amit(dot)kapila16(at)gmail(dot)com>
Cc: "Magnus Hagander" <magnus(at)hagander(dot)net>, "PostgreSQL-development" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [bug fix] pg_ctl always uses the same event source
Date: 2013-12-11 15:01:04
Message-ID: 8192627E48244905AD6E16C1DAD39CD5@maumau
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>> From: "Amit Kapila" <amit(dot)kapila16(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2013-12-11 15:07:19 Re: Why the buildfarm is all pink
Previous Message Kevin Grittner 2013-12-11 14:59:45 Re: Why the buildfarm is all pink