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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: now() AT TIME ZONE interval '-5 hours' returns type interval???
Дата
Msg-id 14991.1047615022@sss.pgh.pa.us
обсуждение исходный текст
Ответ на now() AT TIME ZONE interval '-5 hours' returns type interval???  (Joshua Moore-Oliva <josh@chatgris.com>)
Ответы Re: now() AT TIME ZONE interval '-5 hours' returns type interval???  (Steve Crawford <scrawford@pinpointresearch.com>)
Список 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 по дате отправления:

Предыдущее
От: Andres Montiel
Дата:
Сообщение: embedding PostgreSQL in a Java application
Следующее
От: James Gregory
Дата:
Сообщение: nested transactions