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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joshua Moore-Oliva <josh(at)chatgris(dot)com>
Cc: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: now() AT TIME ZONE interval '-5 hours' returns type interval???
Date: 2003-03-14 04:10:22
Message-ID: 14991.1047615022@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Joshua Moore-Oliva <josh(at)chatgris(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andres Montiel 2003-03-14 04:15:49 embedding PostgreSQL in a Java application
Previous Message Marc G. Fournier 2003-03-14 02:17:03 Re: removal from list