On Mon, 2025-07-14 at 13:09 -0400, Tom Lane wrote:
> "David G. Johnston" <david.g.johns...@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


Reply via email to