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

From Craig Ringer
Subject Re: BUG #6047: prepare p1 as select 'now'::timestamp; then "execute p1" many times, they return the same time
Date
Msg-id 4DE74F09.8080404@postnewspapers.com.au
Whole thread Raw
In response to BUG #6047: prepare p1 as select 'now'::timestamp; then "execute p1" many times, they return the same time  ("" <wcting163@163.com>)
List pgsql-bugs
On 02/06/11 10:53, wcting163@163.com wrote:
> but, what about "prepare p1 as select 'today'::timestamp"??
> today() is not a builtin function, we can't change it to "select
> today()::timestamp";

The keyword-to-timestamp conversions are ugly historical hacks.

Use the SQL-standard current_date, current_time, and current_timestamp
keywords instead.

http://www.postgresql.org/docs/current/static/functions-datetime.html#FUNCTIONS-DATETIME-CURRENT

--
Craig Ringer

pgsql-bugs by date:

Previous
From: ""
Date:
Subject: BUG #6047: prepare p1 as select 'now'::timestamp; then "execute p1" many times, they return the same time
Next
From: "Artiom Makarov"
Date:
Subject: BUG #6048: TRUNCATE vs TRUNCATE CASCADE: misleading message