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

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: wcting163(at)163(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #6047: prepare p1 as select 'now'::timestamp; then "execute p1" many times, they return the same time
Date: 2011-06-02 08:51:21
Message-ID: 4DE74F09.8080404@postnewspapers.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 02/06/11 10:53, wcting163(at)163(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Artiom Makarov 2011-06-02 11:23:42 BUG #6048: TRUNCATE vs TRUNCATE CASCADE: misleading message
Previous Message wcting163 2011-06-02 02:53:01 BUG #6047: prepare p1 as select 'now'::timestamp; then "execute p1" many times, they return the same time