On Thu, Jan 23, 2014 at 9:23 AM, Amit Kapila <amit.kapila16@gmail.com> wrote:
> On Thu, Jan 23, 2014 at 10:26 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Amit Kapila <amit.kapila16@gmail.com> writes:
>>> On Wed, Jan 22, 2014 at 9:03 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>>>> So? Anything which can know the value of a GUC parameter can certainly
>>>> know the selected port number.
>>
>>> 1. In case of registration of event source, either user has to pass the name
>>> or it uses hard coded default value, so if we use version number along with
>>> 'PostgreSQL', it can be consistent.
>>> I don't see any way pgevent.c can know port number to append it to default
>>> value, am I missing something here?
>>
>>
>> I think what we might want to do is redefine the server's behavior
>> as creating an event named after the concatenation of event_source
>> and port number, or maybe even get rid of event_source entirely and
>> just say it's "PostgreSQL" followed by the port number.
>
> To accomplish this behaviour, each time server starts and stops,
> we need to register and unregister event log using mechanism
> described at below link to ensure that there is no mismatch between
> what server uses and what OS knows.
> http://www.postgresql.org/docs/devel/static/event-log-registration.html
Why wouldn't that be necessary with your approach, too? I mean, if
there's a GUC that controls the event source name, then it can be
changed between restarts, regardless of what you call it.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company