Thread: AT TIME ZONE bug in CVS?

AT TIME ZONE bug in CVS?

From
"Christopher Kings-Lynne"
Date:
What's with this?

template1=# select current_timestamp(0);     timestamptz
------------------------2002-08-21 16:39:40+08
(1 row)

template1=# set time zone 'Australia/Sydney';
SET
template1=# select current_timestamp(0);     timestamptz
------------------------2002-08-21 18:39:49+10
(1 row)

template1=# select current_timestamp(0) at time zone 'Australia/Sydney';
ERROR:  Time zone 'australia/sydney' not recognized
template1=# select current_timestamp(0) at time zone 'AEST';     timezone
---------------------2002-08-21 18:40:07
(1 row)

Shouldn't the textual version of the time zone work using 'at time zone' as
well as 'set time zone'?

And also, why does the column name change from timestamptz to timezone?
Anyway, shouldn't it in fact be current_timestamp?

Chris



Re: AT TIME ZONE bug in CVS?

From
Thomas Lockhart
Date:
> template1=# select current_timestamp(0) at time zone 'Australia/Sydney';
> ERROR:  Time zone 'australia/sydney' not recognized

The input is done using an internal lookup, not your system's time zone
database. Much faster; setting time zone variables for every input will
be substantially slower (though I haven't measured how much, it will
involve opening files etc etc).

> And also, why does the column name change from timestamptz to timezone?
> Anyway, shouldn't it in fact be current_timestamp?

The feature is implemented as a function call to timezone(), which
returns a string. If it stayed a timestamp or something like that the
time zone can not be "frozen" through the formatting/output process.
                  - Thomas