Received: from smtp07.mail.onemain.com (SMTP-OUT003.ONEMAIN.COM [63.208.208.73]) by postgresql.org (8.11.3/8.11.1) with SMTP id f4DNnCA55609 for ; Sun, 13 May 2001 19:49:12 -0400 (EDT) (envelope-from egm2@jps.net) Received: (qmail 23529 invoked from network); 13 May 2001 23:48:49 -0000 Received: from unknown (HELO localhost) ([216.119.36.135]) (envelope-sender ) by smtp07.mail.onemain.com (qmail-ldap-1.03) with SMTP for ; 13 May 2001 23:48:49 -0000 Received: from felix by localhost with local (Exim 3.22 #1 (Debian)) id 14z5cA-0000HG-00 for ; Sun, 13 May 2001 16:49:30 -0700 Date: Sun, 13 May 2001 16:49:29 -0700 From: "Eric G. Miller" To: PostgreSQL General Subject: Re: Bug with timestamp !!! Message-ID: <20010513164929.A307@calico.local> Mail-Followup-To: "Eric G. Miller" , PostgreSQL General References: <9dj2rq$1ij$1@news.tht.net> <20010512225651.A17727@calico.local> <3449.989767665@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.17i In-Reply-To: <3449.989767665@sss.pgh.pa.us>; from tgl@sss.pgh.pa.us on Sun, May 13, 2001 at 11:27:45AM -0400 X-Archive-Number: 200105/589 X-Sequence-Number: 9448 On Sun, May 13, 2001 at 11:27:45AM -0400, Tom Lane wrote: > "Eric G. Miller" writes: > > While I don't see such dramatic results with this bad input data, I did > > run across something a little peculiar: > > With what PG version? On what platform? # select version(); version --------------------------------------------------------------- PostgreSQL 7.1.1 on i686-pc-linux-gnu, compiled by GCC 2.95.4 Debian GNU/Linux, "unstable" GNU libc6 2.2.3-1 > Comparing 7.1.1 against 7.0.*, I note that the resolution of "illegal" > times during a DST jump has changed, at least on my platform (HPUX 10.20). > 7.0.* resolves the time backwards whereas current sources resolve > forwards: "select timestamp('2001-04-01 02:02:02')" yields > 2001-04-01 01:02:02-05 in 7.0.2 > 2001-04-01 03:02:02-04 in current > Since this is dependent on how the local mktime() library routine > reacts to "illegal" times, some platform-to-platform variation is to be > expected. Your example looks like mktime() must actually have some > internal state on your machine, causing its result to depend on what > it was asked previously :-( Yes, I think the timezone environment variable is being carried. I wrote a small test program, and the same weirdness happens. So, it's not specifically a PostgreSQL issue. -- Eric G. Miller