X-Original-To: pgsql-patches-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id EBC2A9DC889 for ; Mon, 20 Mar 2006 19:12:18 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 11782-02 for ; Mon, 20 Mar 2006 19:12:21 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mailbox.samurai.com (mailbox.samurai.com [205.207.28.82]) by postgresql.org (Postfix) with ESMTP id EA3A19DC80E for ; Mon, 20 Mar 2006 19:12:16 -0400 (AST) Received: from localhost (mailbox.samurai.com [205.207.28.82]) by mailbox.samurai.com (Postfix) with ESMTP id D7B782397B4; Mon, 20 Mar 2006 18:12:19 -0500 (EST) Received: from mailbox.samurai.com ([205.207.28.82]) by localhost (mailbox.samurai.com [205.207.28.82]) (amavisd-new, port 10024) with LMTP id 29727-01; Mon, 20 Mar 2006 18:12:18 -0500 (EST) Received: from [42.65.238.42] (U40.N129.QueensU.CA [130.15.129.40]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mailbox.samurai.com (Postfix) with ESMTP id 468CC239738; Mon, 20 Mar 2006 18:12:18 -0500 (EST) Message-ID: <441F3729.5060109@samurai.com> Date: Mon, 20 Mar 2006 18:13:45 -0500 From: Neil Conway User-Agent: Thunderbird 1.5 (Macintosh/20051201) MIME-Version: 1.0 To: Bruce Momjian CC: Peter Eisentraut , pgsql-patches@postgresql.org, Brendan Jurd Subject: Re: Additional current timestamp values References: <200603202302.k2KN26J07336@candle.pha.pa.us> In-Reply-To: <200603202302.k2KN26J07336@candle.pha.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at mailbox.samurai.com X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=1.452 required=5 tests=[AWL=0.120, RCVD_IN_BL_SPAMCOP_NET=1.332] X-Spam-Score: 1.452 X-Spam-Level: * X-Archive-Number: 200603/216 X-Sequence-Number: 19220 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, : (1) The 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 that is not generally contained in a . All s that are contained in s that are generally contained, without an intervening whose subject routines do not include an SQL function, either in S without an intervening or in an contained in the of a trigger activated as a consequence of executing S, are effectively evaluated simultaneously. The time of evaluation of a during the execution of S and its activated triggers is implementation-dependent. -Neil