Re: Bug #630: date/time storage problem: timestamp parsed - Mailing list pgsql-bugs

From Thomas Lockhart
Subject Re: Bug #630: date/time storage problem: timestamp parsed
Date
Msg-id 3CB27DEE.D0D669F6@fourpalms.org
Whole thread Raw
In response to Bug #630: date/time storage problem: timestamp parsed incorrectly...  (pgsql-bugs@postgresql.org)
Responses Re: Bug #630: date/time storage problem: timestamp parsed  (Sean Chittenden <sean@chittenden.org>)
List pgsql-bugs
> $ uname -a
> FreeBSD ninja1.internal 4.5-STABLE FreeBSD 4.5-STABLE #0: Fri Apr  5 18:08:12 PST 2002
root@ninja1.internal:/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
> # SELECT version();
>                           version
> ------------------------------------------------------------
>  PostgreSQL 7.2 on i386--freebsd4.5, compiled by GCC 2.95.3
> 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?

PostgreSQL uses system calls to get the current time zone if it is not
specified in the input string.

I'm running a fairly new Linux (Mandrake distro), which has the zinc
package as part of glibc-2.2.4

Do you have another way to verify your time zone setup? Do you have the
"zdump" command to look at your time zone info? If you want to step
through your PostgreSQL code, I could give you some suggestions on what
to look for:

1) run the backend using "gdb postgres"

2) before telling gdb to "run", set a breakpoint on DecodeDateTime and
DetermineLocalTimeZone. Use "b DecodeDateTime".

3) run the program. Use "run <dbname>" where <dbname> might be your user
name.

4) at the prompt, type in the above query.

5) at first breakpoint, continue by typing "c".

6) at the DetermineLocalTimeZone breakpoint, start stepping through code
with "s". Check values as you go along.

hth

                      - Thomas

pgsql-bugs by date:

Previous
From: Sean Chittenden
Date:
Subject: Re: Bug #630: date/time storage problem: timestamp parsed incorrectly...
Next
From: Sean Chittenden
Date:
Subject: Re: Bug #630: date/time storage problem: timestamp parsed