Re: What's special about 1916-10-01 02:25:20? Odd jump in internal timestamptz representation

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: What's special about 1916-10-01 02:25:20? Odd jump in internal timestamptz representation
Дата
Msg-id 19843.1154093352@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: What's special about 1916-10-01 02:25:20? Odd jump in internal timestamptz representation  ("Alistair Bayley" <alistair@abayley.org>)
Ответы Re: What's special about 1916-10-01 02:25:20? Odd jump in internal timestamptz representation
Список pgsql-general
"Alistair Bayley" <alistair@abayley.org> writes:
> I was puzzled as to why it is set to Dublin when my machine's Time
> Zone is GMT.  I saw in the docs that in the absense of an entry in the
> .conf file or a TZ environment variable results in a guess; this seems
> to be the cause here. I see in
> http://developer.postgresql.org/cvsweb.cgi/pgsql/src/timezone/pgtz.c?rev=1.44
> that the rule seems to prefer shorter names when there's a tie, and
> win32_tzmap has Europe/Dublin as the shortest entry in the GMT
> section, so perhaps that's the reason... the best choice for me would
> have been GMT.

That is strange, seeing that "GMT" is surely textually shorter.  And the
probing function does check as far back as 1916 (indeed back to 1904)
so I don't see why it'd not notice the difference anyway.  Could you
trace through it (either with gdb, or add some debug elogs in pgtz.c)
and see why it doesn't give you the right choice?

> Is it possible for a client to have a different time zone from the
> server, or is the only time zone we consider the server time zone?

Any individual session can SET TIMEZONE to whatever it wants.  The point
here is just what the startup default is.

> Why do we not simply
> use TZ on the client, instead of PGTZ?

Why do you think the client machine is any more likely to have a correct
setting of TZ than the server?  I'd guess the opposite myself.

> Also, is it correct for the docs to state that Julian dates are used?

I think you're confused about "Julian dates" vs "Julian days".  The
latter is just a term for counting from a specific epoch day sometime
back in 4000-something BC.  We use the Gregorian calendar though.

            regards, tom lane

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

Предыдущее
От: "Alistair Bayley"
Дата:
Сообщение: Re: What's special about 1916-10-01 02:25:20? Odd jump in internal timestamptz representation
Следующее
От: Scott Ribe
Дата:
Сообщение: Re: Database Design Theory - PostgreSQL Custom Types