Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g5pnf-0005bx-Sb for pgsql-hackers@arkaria.postgresql.org; Fri, 28 Sep 2018 10:15:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g5pne-0000lR-3Y for pgsql-hackers@arkaria.postgresql.org; Fri, 28 Sep 2018 10:15:06 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g5pnd-0000lG-PQ for pgsql-hackers@lists.postgresql.org; Fri, 28 Sep 2018 10:15:05 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1g5pnb-0002GW-36 for pgsql-hackers@postgresql.org; Fri, 28 Sep 2018 10:15:04 +0000 Received: from bruce by momjian.us with local (Exim 4.84_2) (envelope-from ) id 1g5pnX-0003Te-Mw; Fri, 28 Sep 2018 06:14:59 -0400 Date: Fri, 28 Sep 2018 06:14:59 -0400 From: Bruce Momjian To: Daniel Verite Cc: Tom Lane , Peter Eisentraut , Michael Paquier , Andres Freund , PostgreSQL-development Subject: Re: transction_timestamp() inside of procedures Message-ID: <20180928101459.GA8989@momjian.us> References: <23174.1537970823@sss.pgh.pa.us> <426715fa-0dd7-4826-b079-1426ca8e6f12@manitou-mail.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <426715fa-0dd7-4826-b079-1426ca8e6f12@manitou-mail.org> User-Agent: Mutt/1.5.23 (2014-03-12) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Wed, Sep 26, 2018 at 09:23:58PM +0200, Daniel Verite wrote: > Tom Lane wrote: > > > I agree that it would be surprising for transaction timestamp to be newer > > than statement timestamp. > > To me it's more surprising to start a new transaction and having > transaction_timestamp() still pointing at the start of a previous > transaction. > This feels like a side-effect of being spawned by a procedure, > and an exception to what transaction_timestamp() normally means > or meant until now. > > OTOH transaction_timestamp() being possibly newer than > statement_timestamp() seems like a normal consequence of > transactions being created intra-statement. Yes, that is a good point. My thought has always been that statements are inside of transactions, but the opposite is now possible. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + As you are, so once was I. As I am, so you will be. + + Ancient Roman grave inscription +