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

Поиск
Список
Период
Сортировка
От MauMau
Тема Re: [bug fix] pg_ctl always uses the same event source
Дата
Msg-id 62785992DF8649FAA795F0DD4D1AC7BC@maumau
обсуждение исходный текст
Ответ на Re: [bug fix] pg_ctl always uses the same event source  (Amit Kapila <amit.kapila16@gmail.com>)
Ответы Re: [bug fix] pg_ctl always uses the same event source
Список pgsql-hackers
From: "Amit Kapila" <amit.kapila16@gmail.com>
> 1. isn't it better to handle as it is done in write_eventlog() which
> means if string is empty then
>    use PostgreSQL.
> "evtHandle = RegisterEventSource(NULL, event_source ? event_source :
> "PostgreSQL");"

Thank you for reviewing.  Yes, I did so with the first revision of this 
patch (see the first mail of this thread.)  I wanted to avoid duplicating 
the default value in both the server and pg_ctl code.  If user does not set 
event_source, postgres -C returns the default value "PostgreSQL" in the 
normal case, so I wanted to rely on it.  I thought the second revision would 
be appreciated by PostgreSQL-based products like EnterpriseDB, because there 
are fewer source files to modify.  But I don't mind which revision will be 
adopted.

> 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?

Yes, but I assume that the user has to set his own name to identify his 
instance uniquely.  Even if version string is added, the same issue can 
happen --- in the likely case where the user explicitly installs, for 
example, PostgreSQL 9.3 as a standalone database, as well as some packaged 
application that embeds PostgreSQL 9.3 which the user is unaware of.
If the user installs multiple versions of PostgreSQL explicitly with the 
community installer, the installer can set event_source = 'PostgreSQL 9.3' 
and 'PostgreSQL 9.4' for each instance.

Regards
MauMau




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Recovery to backup point
Следующее
От: Euler Taveira
Дата:
Сообщение: JSON decoding plugin