Re: [BUGS] Bug #630: date/time storage problem: timestamp parsed incorrectly...

2002-04-15 Thread Sean Chittenden

> > date/time storage problem: timestamp parsed incorrectly...
>
> > It looks like a bad parser or defaults for time values.  The
> > example code below explains the problem best.  I'm not sure why,
> > or where... but it took me about a day to track down (PostgreSQL
> > is never wrong!).  If I include a timezone, things seem to work.
> > For some reason, only dates from yesterday and today break
> > things... I think it's because -7 is the same as my timezone, PST
> > (now -7).
> 
> Well, as long as you realize that PostgreSQL is always right you are
> on track ;)
> 
> I'm guessing that you have a damaged timezone database on your
> system.  What time zone does your system think it is in? What system
> are you running on? I'm not seeing a problem on my Linux box running
> 7.2 (well, except for the jump at the time zone boundary):
> 
> lockhart=# select timestamp '2002-4-7 2:0:0.0';
>   timestamptz   
> 
>  2002-04-07 01:00:00-08
> (1 row)
> 
> But that is not the 2036 result you are seeing, so I can only
> speculate on your specific problem...

ACK!  Hmm... fresh build of FreeBSD:

$ uname -a
FreeBSD ninja1.internal 4.5-STABLE FreeBSD 4.5-STABLE #0: Fri Apr  5 18:08:12 PST 2002 
[EMAIL PROTECTED]:/opt/obj/opt/src/sys/NINJA  i386

$ psql
# SELECT timestamp '2002-4-7 2:0:0.0';
  timestamptz   

 2036-06-02 22:57:08-07
(1 row)

# SELECT version();
  version   

 PostgreSQL 7.2 on i386--freebsd4.5, compiled by GCC 2.95.3
(1 row)

This isn't happy making.  What OS are you running?  Seems like a lower
level problem.  Do you know if it's a system call making the
formatting call?  -sc


-- 
Sean Chittenden

---(end of broadcast)---
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]



Re: [BUGS] Bug #630: date/time storage problem: timestamp parsed incorrectly...

2002-04-08 Thread Sean Chittenden

> > date/time storage problem: timestamp parsed incorrectly...
>
> > It looks like a bad parser or defaults for time values.  The
> > example code below explains the problem best.  I'm not sure why,
> > or where... but it took me about a day to track down (PostgreSQL
> > is never wrong!).  If I include a timezone, things seem to work.
> > For some reason, only dates from yesterday and today break
> > things... I think it's because -7 is the same as my timezone, PST
> > (now -7).
> 
> Well, as long as you realize that PostgreSQL is always right you are
> on track ;)
> 
> I'm guessing that you have a damaged timezone database on your
> system.  What time zone does your system think it is in? What system
> are you running on? I'm not seeing a problem on my Linux box running
> 7.2 (well, except for the jump at the time zone boundary):
> 
> lockhart=# select timestamp '2002-4-7 2:0:0.0';
>   timestamptz   
> 
>  2002-04-07 01:00:00-08
> (1 row)
> 
> But that is not the 2036 result you are seeing, so I can only
> speculate on your specific problem...

ACK!  Hmm... fresh build of FreeBSD:

$ uname -a
FreeBSD ninja1.internal 4.5-STABLE FreeBSD 4.5-STABLE #0: Fri Apr  5 18:08:12 PST 2002 
[EMAIL PROTECTED]:/opt/obj/opt/src/sys/NINJA  i386

$ psql
# SELECT timestamp '2002-4-7 2:0:0.0';
  timestamptz   

 2036-06-02 22:57:08-07
(1 row)

# SELECT version();
  version   

 PostgreSQL 7.2 on i386--freebsd4.5, compiled by GCC 2.95.3
(1 row)

This isn't happy making.  What OS are you running?  Seems like a lower
level problem.  Do you know if it's a system call making the
formatting call?  -sc

-- 
Sean Chittenden

---(end of broadcast)---
TIP 6: Have you searched our list archives?

http://archives.postgresql.org



[BUGS] Bug #630: date/time storage problem: timestamp parsed incorrectly...

2002-04-08 Thread pgsql-bugs

Sean Chittenden ([EMAIL PROTECTED]) reports a bug with a severity of 2
The lower the number the more severe it is.

Short Description
date/time storage problem: timestamp parsed incorrectly...

Long Description
It looks like a bad parser or defaults for time values.  The example code below 
explains the problem best.  I'm not sure why, or where... but it took me about a day 
to track down (PostgreSQL is never wrong!).  If I include a timezone, things seem to 
work.  For some reason, only dates from yesterday and today break things... I think 
it's because -7 is the same as my timezone, PST (now -7).

Sample Code
CREATE TABLE timestamp_test (
  utc_timestamp TIMESTAMP NOT NULL
);

INSERT INTO timestamp_tmp VALUES ('2002-4-7 2:0:0.0');
SELECT * from timestamp_tmp;
utc_date

 2036-06-02 22:55:24-07
(1 row)
INSERT INTO timestamp_tmp VALUES ('2002-4-7 -8 2:0:0.0');
SELECT * from timestamp_tmp;
utc_date

 2036-06-02 22:55:24-07
 2002-04-07 03:00:00-07
(2 rows)


No file was uploaded with this report


---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])