Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 7BD8C47616D for ; Fri, 4 Oct 2002 01:03:16 -0400 (EDT) Received: from anchor-post-39.mail.demon.net (anchor-post-39.mail.demon.net [194.217.242.80]) by postgresql.org (Postfix) with ESMTP id CB8E247615D for ; Fri, 4 Oct 2002 01:03:15 -0400 (EDT) Received: from lfix.demon.co.uk ([158.152.59.127] helo=linda.lfix.co.uk) by anchor-post-39.mail.demon.net with esmtp (Exim 3.36 #2) id 17xKcM-0002ji-0U; Fri, 04 Oct 2002 06:03:14 +0100 Received: from localhost ([127.0.0.1] helo=localhost.localdomain ident=olly) by linda.lfix.co.uk with esmtp (Exim 3.36 #1 (Debian)) id 17xKcL-0004yt-00; Fri, 04 Oct 2002 06:03:13 +0100 Subject: Re: [SQL] [GENERAL] CURRENT_TIMESTAMP From: Oliver Elphick To: Bruce Momjian Cc: Tom Lane , Andrew Sullivan , PostgreSQL-development In-Reply-To: <200210040041.g940fx615950@candle.pha.pa.us> References: <200210040041.g940fx615950@candle.pha.pa.us> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Mailer: Ximian Evolution 1.0.8 Date: 04 Oct 2002 06:03:13 +0100 Message-Id: <1033707793.722.963.camel@linda> Mime-Version: 1.0 X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200210/203 X-Sequence-Number: 29972 On Fri, 2002-10-04 at 01:41, Bruce Momjian wrote: > Well, let's see what others say. If no one is excited about the change, > we can just document its current behavior. Oh, I see it is already > documented in func.sgml: > > It is quite important to realize that > CURRENT_TIMESTAMP and related functions all return > the time as of the start of the current transaction; their values do not > increment while a transaction is running. But > timeofday() returns the actual current time. > > Seems that isn't helping enough to reduce the number of people who are > surprised by our behavior. I don't think anyone would be surprised by > statement time. > > What do others think? I would prefer that CURRENT_TIME[STAMP] always produce the same time within a transaction. If it is changed, it will certainly break one of my applications, which explicitly depends on the current behaviour. If you change it, please provide an alternative way of doing the same thing. I can see that the current behaviour might give surprising results in a long running transaction. Surprise could be reduced by giving the time of first use within the transaction rather than the start of the transaction. -- Oliver Elphick Oliver.Elphick@lfix.co.uk Isle of Wight, UK http://www.lfix.co.uk/oliver GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C ======================================== "For the word of God is quick, and powerful, and sharper than any twoedged sword, piercing even to the dividing asunder of soul and spirit, and of the joints and marrow, and is a discerner of the thoughts and intents of the heart." Hebrews 4:12