AW: AW: AW: Re: tinterval - operator problems on AIX

From: Zeugswetter Andreas SB <ZeugswetterA(at)wien(dot)spardat(dot)at>
To: "'lockhart(at)fourpalms(dot)org'" <lockhart(at)fourpalms(dot)org>
Cc: "'pgsql-hackers(at)postgresql(dot)org'" <pgsql-hackers(at)postgresql(dot)org>
Subject: AW: AW: AW: Re: tinterval - operator problems on AIX
Date: 2001-01-11 09:04:54
Message-ID: 11C1E6749A55D411A9670001FA6879633681A4@sdexcsrv1.f000.d0188.sd.spardat.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


> > > > On AIX mktime(3) leaves tm_isdst at -1 if it does not have timezone
> > > > info for that particular year and returns -1.
> > > > The following code then makes savings time out of the -1.
> > > > tz = (tm->tm_isdst ? (timezone - 3600) : timezone);
> > > Hmm. That description is consistant with what I see in the Linux man
> > > page. So I should check for (tm->tm_isdst > 0) rather than
> > > checking for non-zero?
> > It is obviously not possible to determine tm_isdst with mktime for a
> > negative time_t. Thus with above fix PST works, but PDT is then busted :-(
>
> Obvious to AIX only?
Yes. The whole subject only concerns AIX (at least so far).
> My conclusion is that the AIX timezone database is
> damaged or missing for pre-1970 dates, but that other systems bothered
> to get it at least somewhat right. Is there another issue here that I'm
> missing?

The tz db is neighter damaged nor missing anything (see below). Only mktime
does not work for some (maybe even avoidable) reason for dates before 1970.

> > localtime does convert a negative time_t correctly including dst.
> > Is there another way to determine tm_isdst ?
>
> Yes. Replace AIX with Linux or something else, then recompile Postgres
> ;)

As I see it, the Linux results are also not 100 % correct in respect to dates
before 1970. (based on assumption that Solaris is correct)

e.g.:
1503c1503
< | Sat May 10 23:59:12 1947 PST
---
> | Sat May 10 23:59:12 1947 PDT

Was 1947 PDT or PST ? In eighter case one result is one hour off, Solaris or Linux.

This raises another issue. Why do we distribute expected files with bogus results
in them ? Imho it would be better to only have expected files for rounding issues and
the like. Else the user feels that horology works fine on his machine, but as it looks it only
works on a few.

Andreas

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Oleg Bartunov 2001-01-11 10:09:19 Re: Re: GiST for 7.1 !!
Previous Message Lincoln Yeoh 2001-01-11 07:43:39 Lock on arbitrary string feature