Timezone abbreviations - out but not in? - Mailing list pgsql-hackers

From Dave Page
Subject Timezone abbreviations - out but not in?
Date
Msg-id 937d27e10806100623i2f3497d0rfd7acecc87311676@mail.gmail.com
Whole thread Raw
Responses Re: Timezone abbreviations - out but not in?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
One of our guys in Pakistan noticed a problem with Slony that seems to
have manifested itself since the last zic update. Slony uses
timeofday() as the default value for a timestamp column:

-- Executing query:
SET timezone='Asia/Karachi';
SELECT timeofday()::timestamp with time zone;

ERROR:  invalid input syntax for type timestamp with time zone: "Tue
Jun 10 19:16:23.186000 2008 PKST"

After a little digging, it was suggested by Heikki that
clock_timestamp() would be a better bet in 8.2+, however, this appears
to have similar issues depending on how it's (mis)used:

-- Executing query:
set timezone='Asia/Karachi';
set datestyle='SQL';
select clock_timestamp()::text::timestamp with time zone;

ERROR:  invalid input syntax for type timestamp with time zone:
"10/06/2008 18:40:36.769046 PKST"

It seems like a bug that we happily output PKST as a timezone (in a
'timestamp with time zone'), but won't accept it back in. Perhaps we
should only output names that we can read back, and revert to a
numeric offset in other cases?

-- 
Dave Page
EnterpriseDB UK:   http://www.enterprisedb.com


pgsql-hackers by date:

Previous
From: Zdenek Kotala
Date:
Subject: Re: RFD: ALTER COLUMN .. SET STORAGE COMPRESSED;
Next
From: "汪琦"
Date:
Subject: why copy tuple in the end of trigger when nothing changed in NEW, OLD record variable