Commit a89112b
committed
feat: add command_tag_omit_oid GUC to drop legacy OID from INSERT tag
Add a new boolean GUC command_tag_omit_oid (default off) that controls
whether the legacy OID field is included in INSERT command completion
tags. When enabled, INSERT returns 'INSERT N' instead of 'INSERT 0 N'.
The '0' is a vestige from PostgreSQL 11 and earlier when tables could
have OIDs. The OID field has been hardcoded to 0 (InvalidOid) since
PostgreSQL 12, but remains in the wire protocol for backward
compatibility.
This GUC is per-session (PGC_USERSET) and supports SET LOCAL for
per-transaction control.
Also update libpq's PQcmdTuples() to handle both formats gracefully,
so client applications work correctly regardless of the server setting.
Files changed:
- src/backend/tcop/cmdtag.c: GUC variable + conditional OID emission
- src/backend/utils/misc/guc_parameters.dat: GUC registration
- src/include/tcop/cmdtag.h: extern declaration
- src/interfaces/libpq/fe-exec.c: handle INSERT with/without OID field1 parent b6eb8dd commit a89112b
4 files changed
Lines changed: 29 additions & 7 deletions
File tree
- src
- backend
- tcop
- utils/misc
- include/tcop
- interfaces/libpq
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
39 | 43 | | |
40 | 44 | | |
41 | 45 | | |
| |||
145 | 149 | | |
146 | 150 | | |
147 | 151 | | |
148 | | - | |
| 152 | + | |
149 | 153 | | |
150 | 154 | | |
151 | 155 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
426 | 426 | | |
427 | 427 | | |
428 | 428 | | |
| 429 | + | |
429 | 430 | | |
430 | 431 | | |
431 | 432 | | |
| |||
435 | 436 | | |
436 | 437 | | |
437 | 438 | | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
438 | 447 | | |
439 | 448 | | |
440 | 449 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
59 | 62 | | |
60 | 63 | | |
61 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3847 | 3847 | | |
3848 | 3848 | | |
3849 | 3849 | | |
3850 | | - | |
3851 | | - | |
3852 | | - | |
3853 | | - | |
3854 | | - | |
3855 | | - | |
| 3850 | + | |
| 3851 | + | |
| 3852 | + | |
| 3853 | + | |
| 3854 | + | |
| 3855 | + | |
| 3856 | + | |
| 3857 | + | |
| 3858 | + | |
| 3859 | + | |
| 3860 | + | |
| 3861 | + | |
3856 | 3862 | | |
3857 | 3863 | | |
3858 | 3864 | | |
| |||
0 commit comments