pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Tom Lane <tgl@sss.pgh.pa.us>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: petermittere@gmail.com
Cc: pgsql-docs@lists.postgresql.org
Subject: Re: please define 'statement' in the glossary
Date: Tue, 15 Jul 2025 07:36:13 +0200
Message-ID: <52a74da36f9c7601e944dc5ba9648368816f22ee.camel@cybertec.at> (raw)
In-Reply-To: <697664.1752512964@sss.pgh.pa.us>
References: <175223006802.3157505.14764328206246105568@wrigleys.postgresql.org>
	<15139c5d218754350e4870062f90ff0e85490290.camel@cybertec.at>
	<270191.1752420426@sss.pgh.pa.us>
	<097e693ea6cc3541cbcd72c915d7d492c26930c0.camel@cybertec.at>
	<456003.1752442676@sss.pgh.pa.us>
	<458204.1752443813@sss.pgh.pa.us>
	<CAKFQuwa4VMoHehuN5qCX5Jv15ZahTJ00jxMu4mbtYNHbJ4PXOA@mail.gmail.com>
	<ec1e6bb700f9eefceea0648656b38ab223c14c54.camel@cybertec.at>
	<685003.1752506254@sss.pgh.pa.us>
	<CAKFQuwYzod+L_vjOuWz8OAte2SoS5V5ByOGfhDx1-ubvHTb11g@mail.gmail.com>
	<CAKFQuwYC-p=2pr__2Gu65HR5E=4fmiwHhacKBrxRYmB2GEqtGw@mail.gmail.com>
	<690858.1752509326@sss.pgh.pa.us>
	<CAKFQuwa2gDZTJm5hkrqubcn1=A3aTDR7HxX-NfF-9fKrp28f+A@mail.gmail.com>
	<697664.1752512964@sss.pgh.pa.us>

On Mon, 2025-07-14 at 13:09 -0400, Tom Lane wrote:
> "David G. Johnston" <david.g.johnston@gmail.com> writes:
> > Ok.  That explains why "statement_timestamp() and transaction_timestamp()
> > return the same value during the first command of a transaction," isn't
> > just stating the obvious.  transaction_timestamp() literally returns the
> > value statement_timestamp().
> 
> Right.  I'm tempted to be more explicit about that, along the lines of
> 
>      <function>statement_timestamp()</function> and <function>transaction_timestamp()</function>
> -    return the same value during the first statement of a transaction, but might
> -    differ during subsequent statements.
> +    return the same value during the first statement of a transaction,
> +    because the transaction timestamp is set by copying the statement
> +    timestamp when a new transaction starts.
> 
> I didn't include that change below though; perhaps it has too much
> whiff of implementation detail.
> 
> > I'm fine with this entire section assuming/stating that extended protocol
> > is in effect and that 53.2.2.1 explains how these behave when executing a
> > multi-statement simple protocol "script".
> 
> It's incorrect to claim that this only applies to extended protocol,
> and besides I thought you didn't want to mention protocol details
> here.  I can't argue with documenting it in the protocol chapter
> though.  So about like this?

+1

This thread doesn't look like we're going to find a wording that will
make everyone happy, but I believe that this patch is a clear improvement.

Quite contrary to David, I would have liked the word "protocol" with
the message, because it gives me personally the right idea, but I am
fine with "message" alone.  After all, a message in PostgreSQL jargon
is a protocol message.

Yours,
Laurenz Albe





view thread (21+ messages)  latest in thread

Message-ID: <52a74da36f9c7601e944dc5ba9648368816f22ee.camel@cybertec.at>
Permalink:  ../52a74da36f9c7601e944dc5ba9648368816f22ee.camel@cybertec.at/
Also on:    postgresql.org/message-id/52a74da36f9c7601e944dc5ba9648368816f22ee.camel@cybertec.at

 · 

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-docs@postgresql.org
  Cc: laurenz.albe@cybertec.at, tgl@sss.pgh.pa.us, david.g.johnston@gmail.com, petermittere@gmail.com, pgsql-docs@lists.postgresql.org
  Subject: Re: please define 'statement' in the glossary
  In-Reply-To: <52a74da36f9c7601e944dc5ba9648368816f22ee.camel@cybertec.at>

* 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