Re: now() AT TIME ZONE interval '-5 hours' returns type interval??? - Mailing list pgsql-general

From Tom Lane
Subject Re: now() AT TIME ZONE interval '-5 hours' returns type interval???
Date
Msg-id 14991.1047615022@sss.pgh.pa.us
Whole thread Raw
In response to now() AT TIME ZONE interval '-5 hours' returns type interval???  (Joshua Moore-Oliva <josh@chatgris.com>)
Responses Re: now() AT TIME ZONE interval '-5 hours' returns type interval???  (Steve Crawford <scrawford@pinpointresearch.com>)
List pgsql-general
Joshua Moore-Oliva <josh@chatgris.com> writes:
> The problem I am having is when I attempt to convert a timestamp with a time
> zone to another time zone.  For example, the statement
> SELECT now() AT TIME ZONE interval '-5 hours'
> returns type interval not timestamp with//out time zone.

This appears to be a simple typo in the pg_proc entry for the function.
The underlying C code thinks it is returning a timestamp without time
zone, but that's not what the pg_proc entry has.

You can fix this in an existing database by doing

UPDATE pg_proc SET prorettype = 1114 WHERE prosrc = 'timestamptz_izone';


            regards, tom lane

pgsql-general by date:

Previous
From: Andres Montiel
Date:
Subject: embedding PostgreSQL in a Java application
Next
From: James Gregory
Date:
Subject: nested transactions