Re: [BUGS] date -> text convertion error

Petter Reinholdtsen <pere@hungry.com>

From: Petter Reinholdtsen <pere@hungry.com>
To: pgsql-bugs@postgreSQL.org
Date: 1999-08-20T17:12:32Z
Lists: pgsql-bugs
> Note the time of day.  This is evidently a timezone-related bug.

You almost make sense, but the real problem here is that the date is
converted to date + clock 0 when casted to datetime.  A more
reasonable way to do it would be converting it to date + clock 12:00.
Then one would avoid the whole problem.

> My guess is that you inserted the data on a system that didn't know
> that 1965-04-24 was a daylight-savings day, and are reading it on a
> system that does (or vice versa?).

It is inserted and read on the same system.  It is crasy that
converting to text and back gives different result:

  pere=> select fname from user_appl where birthdate != birthdate::text::date;
  fname
  -----
  Antal
  (1 row)
 
  pere=>

GNU libc seems to have zoneinfo for Norway back to before 1916, so I
don't think your guess is correct.
-- 
##>  Petter Reinholdtsen <##    | pere@td.org.uit.no
 O-  <SCRIPT Language="Javascript">window.close()</SCRIPT>
http://www.hungry.com/~pere/    | Go Mozilla, go! Go!