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

Commit39b8c29

Browse files
committed
Fix incorrect comment regarding command completion tags
The comment talked about some Asserts which did not exist and also avariable name which seems to have long since disappeared.Rewrite the comment in a way that will hopefully stand the test oftime and inform people why we always write "INSERT 0 <nrows>" instead of"INSERT <nrows>" in the command completion tag for INSERT.Reviewed-by: Mark DilgerDiscussion:https://postgr.es/m/CAApHDvpiUg09AvvGAVopNAKemA9z-kCmt7Fi6HKauc32bKzx4w@mail.gmail.com
1 parentba185d3 commit39b8c29

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

‎src/backend/tcop/dest.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -178,17 +178,18 @@ EndCommand(const QueryCompletion *qc, CommandDest dest, bool force_undecorated_o
178178
/*
179179
* We assume the tagname is plain ASCII and therefore requires no
180180
* encoding conversion.
181-
*
182-
* We no longer display LastOid, but to preserve the wire
183-
* protocol, we write InvalidOid where the LastOid used to be
184-
* written.
185-
*
186-
* All cases where LastOid was written also write nprocessed
187-
* count, so just Assert that rather than having an extra test.
188181
*/
189182
tag=qc->commandTag;
190183
tagname=GetCommandTagName(tag);
191184

185+
/*
186+
* In PostgreSQL versions 11 and earlier, it was possible to
187+
* create a table WITH OIDS. When inserting into such a table,
188+
* INSERT used to include the Oid of the inserted record in the
189+
* completion tag. To maintain compatibility in the wire
190+
* protocol, we now write a "0" (for InvalidOid) in the location
191+
* where we once wrote the new record's Oid.
192+
*/
192193
if (command_tag_display_rowcount(tag)&& !force_undecorated_output)
193194
snprintf(completionTag,COMPLETION_TAG_BUFSIZE,
194195
tag==CMDTAG_INSERT ?

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp