pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <pgman@candle.pha.pa.us>
To: Neil Conway <neilc@samurai.com>
Cc: Peter Eisentraut <peter_e@gmx.net>
Cc: pgsql-patches@postgresql.org, Brendan Jurd <direvus@gmail.com>
Subject: Re: Additional current timestamp values
Date: Mon, 20 Mar 2006 18:19:23 -0500 (EST)
Message-ID: <200603202319.k2KNJNs10543@candle.pha.pa.us> (raw)
In-Reply-To: <441F3729.5060109@samurai.com>

Neil Conway wrote:
> 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.

OK, so we just decided transaction timestamp is the most logical value
for CURRENT_TIMESTAMP.  Anyway, this might mean we should have
transaction_timestamp for completeness.  Not sure.

-- 
  Bruce Momjian   http://candle.pha.pa.us
  SRA OSS, Inc.   http://www.sraoss.com

  + If your life is a hard drive, Christ can be your backup. +



view thread (21+ messages)  latest in thread

Message-ID: <200603202319.k2KNJNs10543@candle.pha.pa.us>
Permalink:  ../200603202319.k2KNJNs10543@candle.pha.pa.us/
Also on:    postgresql.org/message-id/200603202319.k2KNJNs10543@candle.pha.pa.us

 · 

reply

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-hackers@postgresql.org
  Cc: pgman@candle.pha.pa.us, neilc@samurai.com, peter_e@gmx.net, direvus@gmail.com
  Subject: Re: Additional current timestamp values
  In-Reply-To: <200603202319.k2KNJNs10543@candle.pha.pa.us>
  References: <441F3729.5060109@samurai.com> <200603202319.k2KNJNs10543@candle.pha.pa.us>

* 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