Re: BUG #6047: prepare p1 as select 'now'::timestamp; then "execute p1" many times, they return the same time

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #6047: prepare p1 as select 'now'::timestamp; then "execute p1" many times, they return the same time
Дата
Msg-id 14435.1307023804@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #6047: prepare p1 as select 'now'::timestamp; then "execute p1" many times, they return the same time  ("" <wcting163@163.com>)
Список pgsql-bugs
"" <wcting163@163.com> writes:
> 1). although i kown that, "the system will convert **now** to a timestamp as
> soon as the constant is parsed",
> i think this is a bug.

Sorry, it's not a bug, and we're not going to change it.

> but, what about "prepare p1 as select 'today'::timestamp"??
> today() is not a builtin function, we can't change it to "select
> today()::timestamp";

You can get that by using date_trunc on the result of now(); or there's
current_date, which is actually SQL-standard unlike these other things.

            regards, tom lane

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: collation problem on 9.1-beta1
Следующее
От: Alexey Klyukin
Дата:
Сообщение: Re: BUG #6048: TRUNCATE vs TRUNCATE CASCADE: misleading message