Re: [GENERAL] CURRENT_TIMESTAMP - Mailing list pgsql-sql

From Tom Lane
Subject Re: [GENERAL] CURRENT_TIMESTAMP
Date
Msg-id 1565.1032883213@sss.pgh.pa.us
Whole thread Raw
In response to Re: [GENERAL] CURRENT_TIMESTAMP  ("Josh Berkus" <josh@agliodbs.com>)
List pgsql-sql
"Josh Berkus" <josh@agliodbs.com> writes:
> So, if I've got this straight:
> [ snip ]
> ... thus changing only current_timestamp.

Yeah, that's more or less what I was thinking.  The argument for
changing current_timestamp seems to be really just spec compliance;
that doesn't apply to now() or timeofday().

> Better yet, how about we introduce a parameter to now()?   Example:
> now() or now('transaction') returns the transaction timestamp.
> now('statement') returns the statement timestamp
> now('immediate') returns the timestamp at the exact time the function
> is called.

I like this.

> We could introduce the new version of now() in 7.4, encourage everyone
> to use it instead of other timestamp calls, and then in 7.5 change the
> behavior of current_timestamp for SQL92 compliance.

I'd be inclined to just do it; we have not been very good about
following through on multi-version sequences of changes.  And the
folks who want a standard-compliant current_timestamp aren't going
to want to migrate to now('statement') instead ...
        regards, tom lane


pgsql-sql by date:

Previous
From: John Hasler
Date:
Subject: Re: [GENERAL] CURRENT_TIMESTAMP
Next
From: Roland Roberts
Date:
Subject: Re: [GENERAL] CURRENT_TIMESTAMP