From: Craig Ringer <craig@postnewspapers.com.au>
To: wcting163@163.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #6047: prepare p1 as select 'now'::timestamp; then "execute p1" many times, they return the same time
Date: Thu, 02 Jun 2011 16:51:21 +0800
Message-ID: <4DE74F09.8080404@postnewspapers.com.au> (raw)
In-Reply-To: <201106020253.p522r1eD076376@wwwmaster.postgresql.org>
References: <201106020253.p522r1eD076376@wwwmaster.postgresql.org>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: craig@postnewspapers.com.au, wcting163@163.com
Subject: Re: BUG #6047: prepare p1 as select 'now'::timestamp; then "execute p1" many times, they return the same time
In-Reply-To: <4DE74F09.8080404@postnewspapers.com.au>
References: <201106020253.p522r1eD076376@wwwmaster.postgresql.org> <4DE74F09.8080404@postnewspapers.com.au>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox