AT TIME ZONE and interval arguments - Mailing list pgsql-general

From Craig Ringer
Subject AT TIME ZONE and interval arguments
Date
Msg-id 510A2DDA.60301@2ndquadrant.com
Whole thread Raw
Responses Re: AT TIME ZONE and interval arguments
Re: AT TIME ZONE and interval arguments
List pgsql-general
Hi all

I'm mildly thrown by this:

regress=> SELECT TIME '04:00' AT TIME ZONE '01:00';
  timezone
-------------
 19:00:00-01
(1 row)

regress=> SELECT TIME '04:00' AT TIME ZONE (INTERVAL '01:00');
  timezone
-------------
 21:00:00+01
(1 row)

regress=> SELECT TIME '04:00' AT TIME ZONE (TEXT '01:00');
  timezone
-------------
 19:00:00-01
(1 row)


and was wondering if anyone knows why the sense of the offset is
reversed for typed intervals vs bare literal or text. Is this another
one of the issues caused by the various standards' disagreements about +
vs - time offsets?

--
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services



pgsql-general by date:

Previous
From: Stuart Bishop
Date:
Subject: Re: Is there a way to add a detail message in a warning with pl/Python?
Next
From: Pavel Stehule
Date:
Subject: Re: Optimizing query?