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: 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-18 04:27:08
Message-ID: CAA4eK1KLR_8=eErCbk2v=w2_nQ0TErzdXAhHMCXSDO3LD4k72Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Dec 17, 2013 at 5:33 PM, MauMau <maumau307(at)gmail(dot)com> wrote:
> From: "Amit Kapila" <amit(dot)kapila16(at)gmail(dot)com>
>
>> Few minor things:
>
> event_source here is a global static char array, so it's automatically
> initialized with zeros and safe to access.

Right, I had missed that point.
>
>
>> 2. minor coding style issue
>
>
> Thanks. I passed the source files through pgindent and attached the revised
> patch. Although the arguments in the second line are not in line with the
> first line's arguments, that's what pgindent found good.

Okay, no problem.

Few other points:
-------------------------
1.
#ifdef WIN32
/* Get event source from postgresql.conf for eventlog output */
get_config_value("event_source", event_source, sizeof(event_source));
#endif

event logging is done for both win32 and cygwin env.
under hash define (Win32 || cygwin),
so event source name should also be retrieved for both
environments. Refer below in code:

#if defined(WIN32) || defined(__CYGWIN__)
static void
write_eventlog(int level, const char *line)

2.
Docs needs to be updated for default value:
http://www.postgresql.org/docs/devel/static/event-log-registration.html
http://www.postgresql.org/docs/devel/static/runtime-config-logging.html#GUC-EVENT-SOURCE

In this patch, we are planing to change default value of event_source
from PostgreSQL to PostgreSQL 9.4 (PostgreSQL PG_MAJORVERSION)
as part of fixing the issue reported in this thread.

If anyone has objection to that, please let us know now to avoid re-work
at later stage.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2013-12-18 06:00:38 Re: Logging WAL when updating hintbit
Previous Message Amit Kapila 2013-12-18 03:22:04 Re: Logging WAL when updating hintbit