Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8ffd9ac

Browse files
committed
Doc: clarify description of current-date/time functions.
Minor wordsmithing of the func.sgml paragraph describingstatement_timestamp() and allied functions: don't switch between"statement" and "command" when those are being used to mean aboutthe same thing.Also, add some text to protocol.sgml describing the perhaps-surprisingbehavior these functions have in a multi-statement Query message.Reported-by: P M <petermittere@gmail.com>Author: Tom Lane <tgl@sss.pgh.pa.us>Reviewed-by: Laurenz Albe <laurenz.albe@cybertec.at>Reviewed-by: David G. Johnston <david.g.johnston@gmail.com>Discussion:https://postgr.es/m/175223006802.3157505.14764328206246105568@wrigleys.postgresql.orgBackpatch-through: 13
1 parentff0bcb2 commit8ffd9ac

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

‎doc/src/sgml/func.sgml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11247,10 +11247,10 @@ now()
1124711247
statement (more specifically, the time of receipt of the latest command
1124811248
message from the client).
1124911249
<function>statement_timestamp()</function> and <function>transaction_timestamp()</function>
11250-
return the same value during the firstcommand of a transaction, but might
11251-
differ during subsequentcommands.
11250+
return the same value during the firststatement of a transaction, but might
11251+
differ during subsequentstatements.
1125211252
<function>clock_timestamp()</function> returns the actual current time, and
11253-
therefore its value changes even within a single SQLcommand.
11253+
therefore its value changes even within a single SQLstatement.
1125411254
<function>timeofday()</function> is a historical
1125511255
<productname>PostgreSQL</productname> function. Like
1125611256
<function>clock_timestamp()</function>, it returns the actual current time,

‎doc/src/sgml/protocol.sgml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -886,6 +886,16 @@ SELCT 1/0;<!-- this typo is intentional -->
886886
Errors detected at semantic analysis or later, such as a misspelled
887887
table or column name, do not have this effect.
888888
</para>
889+
890+
<para>
891+
Lastly, note that all the statements within the Query message will
892+
observe the same value of <function>statement_timestamp()</function>,
893+
since that timestamp is updated only upon receipt of the Query
894+
message. This will result in them all observing the same
895+
value of <function>transaction_timestamp()</function> as well,
896+
except in cases where the query string ends a previously-started
897+
transaction and begins a new one.
898+
</para>
889899
</sect3>
890900
</sect2>
891901

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp