Platform dependency in timestamp parsing

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Thomas Lockhart <lockhart(at)fourpalms(dot)org>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Platform dependency in timestamp parsing
Date: 2001-10-19 22:29:24
Message-ID: 10123.1003530564@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Using current sources, the following sequence:

set DateStyle TO 'Postgres';
set TimeZone TO 'PST8PDT';
select '2001-09-22T18:19:20'::timestamp(2);

produces

timestamptz
------------------------------
Sat Sep 22 11:19:20 2001 PDT

on my HPUX box, and evidently also on your machine because that's
what's in the timestamptz expected file. However, on a LinuxPPC
machine I get

timestamptz
------------------------------
Sat Sep 22 18:19:20 2001 PDT

ie, the value after 'T' is interpreted as local time not GMT time.

Question 1: which behavior is correct per spec? I'd have expected
local time myself, but I'm not sure where this is specified.

Question 2: where to look for the reason for the difference in the
code? I'm a tad surprised that the HP box behaves more like
yours does than the LinuxPPC box ...

regards, tom lane

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Johann Zuschlag 2001-10-19 22:41:11 Error while restoring database
Previous Message Tom Lane 2001-10-19 21:50:01 Detecting glibc getopt?