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

From: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: MauMau <maumau307(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [bug fix] pg_ctl always uses the same event source
Date: 2014-01-22 04:20:23
Message-ID: CAA4eK1+RpLPvk5oZbpitFjs+rUf=Q+Jzai4L0Yj+dZ+0wKLQZg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jan 22, 2014 at 9:19 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> writes:
>> On Tue, Jan 21, 2014 at 6:57 PM, MauMau <maumau307(at)gmail(dot)com> wrote:
>>> To follow this, we have the line as:
>>>
>>> #event_source = 'PostgreSQL 9.4'
>>>
>>> But this requires us to change this line for each major release. That's a
>>> maintenance headache.
>
>> What I had in mind was to change it during initdb, we are already doing it
>> for some other parameter (unix_socket_directories),
>
> What happens when somebody copies their postgresql.conf from an older
> version? That's hardly uncommon, even though it might be considered bad
> practice. I don't think it's a good idea to try to insert a version
> identifier this way.
>
> But ... what's the point of including the PG version in this string
> anyhow? If you're trying to make the string unique across different
> installations on the same machine, it's surely insufficient, and if
> that's not the point then what is?

Well, certainly it cannot handle all different scenario's (particularly
same version installations), but the original report for this case was
for different versions of server. I think chances of having different
versions of server are much more, which will be handled by this
case. I felt even service name should include and we already have
Fixme in code for it, but thats separate patch altogether.
pg_ctl.c
..
(static char *register_servicename = "PostgreSQL";
/* FIXME: + version ID? */

Also, I referred other s/w's which are registered for event source on
my m/c and I found it is common to include version number in some
form to distinguish different versions. For example, some of the
registered ones are:

Microsoft.Transactions.Bridge 3.0.0.0
Microsoft.Transactions.Bridge 4.0.0.0

ServiceModel Audit 3.0.0.0
ServiceModel Audit 4.0.0.0

I have also seen such a way to append versions to service names as
well.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2014-01-22 04:43:44 Re: Funny representation in pg_stat_statements.query.
Previous Message Peter Geoghegan 2014-01-22 04:05:28 Re: Storing pg_stat_statements query texts externally, pg_stat_statements in core