From: Bruce Momjian <bruce@momjian.us>
To: Daniel Verite <daniel@manitou-mail.org>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Peter Eisentraut <peter.eisentraut@2ndquadrant.com>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Andres Freund <andres@anarazel.de>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: transction_timestamp() inside of procedures
Date: Fri, 28 Sep 2018 06:14:59 -0400
Message-ID: <20180928101459.GA8989@momjian.us> (raw)
In-Reply-To: <426715fa-0dd7-4826-b079-1426ca8e6f12@manitou-mail.org>
References: <23174.1537970823@sss.pgh.pa.us>
<426715fa-0dd7-4826-b079-1426ca8e6f12@manitou-mail.org>
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 <bruce@momjian.us> 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 +
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-hackers@postgresql.org
Cc: bruce@momjian.us, daniel@manitou-mail.org, tgl@sss.pgh.pa.us, peter.eisentraut@2ndquadrant.com, michael@paquier.xyz, andres@anarazel.de
Subject: Re: transction_timestamp() inside of procedures
In-Reply-To: <20180928101459.GA8989@momjian.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