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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Alistair Bayley" <alistair(at)abayley(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: What's special about 1916-10-01 02:25:20? Odd jump in internal timestamptz representation
Date: 2006-07-28 13:29:12
Message-ID: 19843.1154093352@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Alistair Bayley" <alistair(at)abayley(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-07-28 14:35:23 Re: Using an alternate PGDATA on RHEL4 with SELinux enabled
Previous Message Jessica M Salmon 2006-07-28 13:25:49 Re: loop with circular updates