Re: Additional current timestamp values

From: Neil Conway <neilc(at)samurai(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-patches(at)postgresql(dot)org, Brendan Jurd <direvus(at)gmail(dot)com>
Subject: Re: Additional current timestamp values
Date: 2006-03-20 23:13:45
Message-ID: 441F3729.5060109@samurai.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Bruce Momjian wrote:
> Peter Eisentraut wrote:
>> The most common complaint that I recall is that current_timestamp
>> returns the transaction timestamp rather than the statement timestamp,
>> which is what many expect. How does your patch address that?
>
> No, we believe the standard requires it.

My copy of SQL 200n has the following to say:

Annex C, paragraph 16:

"The time of evaluation of the CURRENT_DATE, CURRENT_TIME, and
CURRENT_TIMESTAMP functions during the execution of an
SQL-statement is implementation-dependent."

6.31, <datetime value function>:

(1) The <datetime value function>s CURRENT_DATE, CURRENT_TIME,
and CURRENT_TIMESTAMP respectively return the current date,
current time, and current timestamp; the time and timestamp values
are returned with time zone displacement equal to the current
default time zone displacement of the SQL-session. [...]

(2) Let S be an <SQL procedure statement> that is not generally
contained in a <triggered action>. All <datetime value function>s
that are contained in <value expression>s that are generally
contained, without an intervening <routine invocation> whose subject
routines do not include an SQL function, either in S without an
intervening <SQL procedure statement> or in an <SQL procedure
statement> contained in the <triggered action> of a trigger
activated as a consequence of executing S, are effectively evaluated
simultaneously. The time of evaluation of a <datetime value
function> during the execution of S and its activated triggers is
implementation-dependent.

-Neil

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2006-03-20 23:17:22 Re: Additional current timestamp values
Previous Message Neil Conway 2006-03-20 23:05:02 Re: Additional current timestamp values

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2006-03-20 23:17:22 Re: Additional current timestamp values
Previous Message Tom Lane 2006-03-20 23:13:10 Re: Removal of backward-compatibility docs mentions