From: Robert Haas on
On Wed, Apr 7, 2010 at 12:20 PM, Stefan Kaltenbrunner
<stefan(a)kaltenbrunner.cc> wrote:
> Tom Lane wrote:
>>
>> Stefan Kaltenbrunner <stefan(a)kaltenbrunner.cc> writes:
>>>
>>> hmm all that code makes me wonder a bit about a more general issue - is
>>> the "fallback to GMT if we fail to actually make sense of the right imezone
>>> to use" actually a good idea?
>>
>> What alternative are you proposing?  Failing to start the server doesn't
>> seem like an attractive choice.
>
> why not? we do error out in a lot of other cases as well... Personally I
> find a hard and clear "something is wrong please fix" much more convinient
> than defaulting to something that is more or less completely arbitrary but
> well...

While I can understand why someone might want that behavior in some
cases, in other cases it might be a severe overreaction.

....Robert

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: Magnus Hagander on
On Wed, Apr 7, 2010 at 7:04 PM, Robert Haas <robertmhaas(a)gmail.com> wrote:
> On Wed, Apr 7, 2010 at 12:20 PM, Stefan Kaltenbrunner
> <stefan(a)kaltenbrunner.cc> wrote:
>> Tom Lane wrote:
>>>
>>> Stefan Kaltenbrunner <stefan(a)kaltenbrunner.cc> writes:
>>>>
>>>> hmm all that code makes me wonder a bit about a more general issue - is
>>>> the "fallback to GMT if we fail to actually make sense of the right imezone
>>>> to use" actually a good idea?
>>>
>>> What alternative are you proposing?  Failing to start the server doesn't
>>> seem like an attractive choice.
>>
>> why not? we do error out in a lot of other cases as well... Personally I
>> find a hard and clear "something is wrong please fix" much more convinient
>> than defaulting to something that is more or less completely arbitrary but
>> well...
>
> While I can understand why someone might want that behavior in some
> cases, in other cases it might be a severe overreaction.

I think the dangerous scenario is if it worked, and then stopped
working. In that case, the database will change it's behavior and it
might go unnoticed. If it's wrong on first install, it'll likely get
noticed..

--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: Stefan Kaltenbrunner on
Magnus Hagander wrote:
> On Wed, Apr 7, 2010 at 7:04 PM, Robert Haas <robertmhaas(a)gmail.com> wrote:
>> On Wed, Apr 7, 2010 at 12:20 PM, Stefan Kaltenbrunner
>> <stefan(a)kaltenbrunner.cc> wrote:
>>> Tom Lane wrote:
>>>> Stefan Kaltenbrunner <stefan(a)kaltenbrunner.cc> writes:
>>>>> hmm all that code makes me wonder a bit about a more general issue - is
>>>>> the "fallback to GMT if we fail to actually make sense of the right imezone
>>>>> to use" actually a good idea?
>>>> What alternative are you proposing? Failing to start the server doesn't
>>>> seem like an attractive choice.
>>> why not? we do error out in a lot of other cases as well... Personally I
>>> find a hard and clear "something is wrong please fix" much more convinient
>>> than defaulting to something that is more or less completely arbitrary but
>>> well...
>> While I can understand why someone might want that behavior in some
>> cases, in other cases it might be a severe overreaction.
>
> I think the dangerous scenario is if it worked, and then stopped
> working. In that case, the database will change it's behavior and it
> might go unnoticed. If it's wrong on first install, it'll likely get
> noticed..

yeah that is one aspect - and in talking to the OP he would have
prefered the database not starting up at all, logging an error and a
hint on setting a fixed timezone in the conf.
Even if if keep the current fallback behaviour we should at least fix
the windows codepath to do the same as the unix codepath does - as in
actually logging that the fallback to GMT happened...



Stefan


--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: Tom Lane on
Stefan Kaltenbrunner <stefan(a)kaltenbrunner.cc> writes:
> yeah that is one aspect - and in talking to the OP he would have
> prefered the database not starting up at all, logging an error and a
> hint on setting a fixed timezone in the conf.

Well, you started from the statement that this was an embedded copy
of postgres ... so most users might not even know it was there,
much less to check its postmaster log for problems. I'm still of
the opinion that refusing to start is an overreaction.

> Even if if keep the current fallback behaviour we should at least fix
> the windows codepath to do the same as the unix codepath does - as in
> actually logging that the fallback to GMT happened...

+1 for that anyway. There already are WARNING messages for the various
Windows failure cases, but compared to the Unix code

ereport(LOG,
(errmsg("could not determine system time zone, defaulting to \"%s\"", "GMT"),
errhint("You can specify the correct timezone in postgresql.conf.")));

they lack either the note about defaulting to GMT or the hint. I guess
we should add both of those to the failure cases in the Windows version
of identify_system_timezone. Should we also change the WARNING errlevel
to LOG? I think the latter is more likely to actually get into the log.

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

From: Tom Lane on
I wrote:
> ereport(LOG,
> (errmsg("could not determine system time zone, defaulting to \"%s\"", "GMT"),

BTW, does anyone remember the reason for making "GMT" nonlocalizable
in these messages? It seems more straightforward to do

(errmsg("could not determine system time zone, defaulting to \"GMT\""),

I suppose we had a reason for doing it the first way but I can't see
what. "GMT" seems a fairly English-centric way of referring to UTC
anyhow; translators might wish to put in "UTC" instead, or some other
spelling. Shouldn't we let them?

regards, tom lane

--
Sent via pgsql-hackers mailing list (pgsql-hackers(a)postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers