From: Eric G. Miller <egm2@jps.net>
To: PostgreSQL General <pgsql-general@postgresql.org>
Subject: Re: Bug with timestamp !!!
Date: Sat, 12 May 2001 22:56:51 -0700
Message-ID: <20010512225651.A17727@calico.local> (raw)
In-Reply-To: <9dj2rq$1ij$1@news.tht.net>
References: <9dj2rq$1ij$1@news.tht.net>
On Sat, May 12, 2001 at 02:23:30PM +0400, Alexander Dederer wrote:
> Look this:
> create table tmp (create_date timestamp);
>
> #insert into tmp values('2001-04-01 02:29:52');
> INSERT 1021715 1
>
> #select * from tmp;
> create_data
> ------------------------
> 2035-05-29 01:33:36-05
> (1 row)
While I don't see such dramatic results with this bad input data, I did
run across something a little peculiar:
<begin test>
drop table date_test;
drop sequence date_test_id_seq;
create sequence date_test_id_seq;
create table date_test (
id integer default nextval('date_test_id_seq'),
ts timestamp,
dt datetime
);
insert into date_test (ts, dt) values
('2001-04-01 01:01:01','2001-04-01 02:02:02');
insert into date_test (ts, dt) values
('2001-04-01 02:02:02','2001-04-01 01:01:01');
insert into date_test (ts, dt) values
('2001-04-01 02:02:02','2001-04-01 03:03:03');
insert into date_test (ts, dt) values
('2001-04-01 03:03:03','2001-04-01 02:02:02');
select * from date_test;
id | ts | dt
----+------------------------+------------------------
1 | 2001-04-01 01:01:01-08 | 2001-04-01 01:02:02-08
2 | 2001-04-01 01:02:02-08 | 2001-04-01 01:01:01-08
3 | 2001-04-01 01:02:02-08 | 2001-04-01 03:03:03-07
4 | 2001-04-01 03:03:03-07 | 2001-04-01 03:02:02-07
(4 rows)
<end test>
Notice how illegal times in the two o'clock hour are interpreted
differently depending on whether the first timestamp occurred before or
after the time zone change. The representations are both technically
the same, though I think it might lead to problems with date arithmetic
later on (I dunno). Daylight savings time should be abolished 8-}
--
Eric G. Miller <egm2@jps.net>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: egm2@jps.net, pgsql-general@postgresql.org
Subject: Re: Bug with timestamp !!!
In-Reply-To: <20010512225651.A17727@calico.local>
References: <9dj2rq$1ij$1@news.tht.net> <20010512225651.A17727@calico.local>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox