pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: Manfred Koizar <mkoi-pg@aon.at>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Bruce Momjian <pgman@candle.pha.pa.us>
Cc: Aaron Held <aaron@MetroNY.com>
Cc: Roberto Mello <rmello@cc.usu.edu>
Cc: Neil Conway <neilc@samurai.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: [GENERAL] CURRENT_TIMESTAMP
Date: Mon, 23 Sep 2002 13:36:59 -0700
Message-ID: <200209231336.59105.josh@agliodbs.com> (raw)
In-Reply-To: <kgmuouku2imliobrrck45ugkc0hlrkbo1v@4ax.com>
References: <21724.1032793386@sss.pgh.pa.us>
	<22827.1032800742@sss.pgh.pa.us>
	<kgmuouku2imliobrrck45ugkc0hlrkbo1v@4ax.com>


Manfred,

> C2: The returned value has to represent a point in time *during* the
> execution of the SQL-statement.
> 
> The only thing an implementor is free to choose is which point in time
> "during the execution of the SQL-statement" is to be returned, i.e. a
> timestamp in the interval between the start of the statement and the
> first time when the value is needed.
> 
> The current implementation only conforms to C1.

I, for one, would judge that the start time of the statement is "during the 
execution"; it would only NOT be "during the execution" if it was a value 
*before* the start time of the statement.  It's a semantic argument.

The spec is, IMHO, rather vague on how this would relate to transactions.  I 
do not find it at all inconsitent that Bruce, Thomas, and co. interpreted a 
transaction to be an extension of an individual SQL statement for this 
purpose (at least, that's what I guess they did).

Thus, if you accept the postulates that:
1) "During" a SQL statement includes the start time of the statement, and
2) A Transaction is the equivalent of a single SQL statement for many 
purposes, 
Then the current behavior is a logical conclusion.

Further, we could not change that behaviour without breaking many people's 
applications.

Ideally, since we get this question a lot, that a compile-time or 
execution-time switch to change the behavior of current_timestamp 
contextually would be nice.   We just need someone who;s interested enough in 
writing one.

-- 
-Josh Berkus
 Aglio Database Solutions
 San Francisco




view thread (61+ messages)  latest in thread

Message-ID: <200209231336.59105.josh@agliodbs.com>
Permalink:  ../200209231336.59105.josh@agliodbs.com/
Also on:    postgresql.org/message-id/200209231336.59105.josh@agliodbs.com

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: josh@agliodbs.com, mkoi-pg@aon.at, tgl@sss.pgh.pa.us, pgman@candle.pha.pa.us, aaron@MetroNY.com, rmello@cc.usu.edu, neilc@samurai.com
  Subject: Re: [GENERAL] CURRENT_TIMESTAMP
  In-Reply-To: <200209231336.59105.josh@agliodbs.com>

* 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