postgres/src/backend
Noah Misch a07e03fd8f Fix data loss at inplace update after heap_update().
As previously-added tests demonstrated, heap_inplace_update() could
instead update an unrelated tuple of the same catalog.  It could lose
the update.  Losing relhasindex=t was a source of index corruption.
Inplace-updating commands like VACUUM will now wait for heap_update()
commands like GRANT TABLE and GRANT DATABASE.  That isn't ideal, but a
long-running GRANT already hurts VACUUM progress more just by keeping an
XID running.  The VACUUM will behave like a DELETE or UPDATE waiting for
the uncommitted change.

For implementation details, start at the systable_inplace_update_begin()
header comment and README.tuplock.  Back-patch to v12 (all supported
versions).  In back branches, retain a deprecated heap_inplace_update(),
for extensions.

Reported by Smolkin Grigory.  Reviewed by Nitin Motiani, (in earlier
versions) Heikki Linnakangas, and (in earlier versions) Alexander
Lakhin.

Discussion: https://postgr.es/m/CAMp+ueZQz3yDk7qg42hk6-9gxniYbp-=bG2mgqecErqR5gGGOA@mail.gmail.com
2024-09-24 15:25:18 -07:00
..
access Fix data loss at inplace update after heap_update(). 2024-09-24 15:25:18 -07:00
archive Apply more quoting to GUC names in messages 2024-09-04 13:50:44 +09:00
backup Define PG_TBLSPC_DIR for path pg_tblspc/ in data folder 2024-09-03 09:11:54 +09:00
bootstrap Increase the number of fast-path lock slots 2024-09-21 20:09:35 +02:00
catalog Fix data loss at inplace update after heap_update(). 2024-09-24 15:25:18 -07:00
commands Fix data loss at inplace update after heap_update(). 2024-09-24 15:25:18 -07:00
executor Optimize tuplestore usage for WITH RECURSIVE CTEs 2024-09-19 15:20:35 +12:00
foreign Restrict accesses to non-system views and foreign tables during pg_dump. 2024-08-05 06:05:33 -07:00
jit Speed up Hash Join by making ExprStates support hashing 2024-08-20 13:38:22 +12:00
lib Implement pg_wal_replay_wait() stored procedure 2024-08-02 21:16:56 +03:00
libpq Remove obsolete unconstify() 2024-09-11 09:18:12 +02:00
main Tighten check for --forkchild argument when spawning child process 2024-07-03 15:53:30 +03:00
nodes Add temporal PRIMARY KEY and UNIQUE constraints 2024-09-17 11:29:30 +02:00
optimizer Don't enter parallel mode when holding interrupts. 2024-09-17 19:53:11 -07:00
parser Add ONLY support for VACUUM and ANALYZE 2024-09-24 18:03:40 +12:00
partitioning Revert support for ALTER TABLE ... MERGE/SPLIT PARTITION(S) commands 2024-08-24 18:48:48 +03:00
po Translation updates 2024-06-24 13:11:27 +02:00
port Require memory barrier support. 2024-07-30 23:01:55 +12:00
postmaster Increase the number of fast-path lock slots 2024-09-21 20:09:35 +02:00
regex Simplify checks for deterministic collations. 2024-09-12 13:35:56 -07:00
replication Prohibit altering invalidated replication slots. 2024-09-13 09:31:23 +05:30
rewrite Avoid inserting PlaceHolderVars in cases where pre-v16 PG did not. 2024-08-30 12:42:12 -04:00
snowball Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
statistics Fix typos and duplicate words 2024-04-18 21:28:07 +02:00
storage Warn if LOCKTAG_TUPLE is held at commit, under debug_assertions. 2024-09-24 15:25:18 -07:00
tcop Increase the number of fast-path lock slots 2024-09-21 20:09:35 +02:00
tsearch Constify fields and parameters in spell.c 2024-08-06 23:04:51 +03:00
utils Allow length=-1 for NUL-terminated input to pg_strncoll(), etc. 2024-09-24 15:15:18 -07:00
.gitignore
common.mk
Makefile Fix make build on MinGW 2024-06-21 08:17:23 +02:00
meson.build meson: Fix import library name in Windows 2024-06-20 09:08:36 +02:00
nls.mk Add missing gettext triggers 2024-05-14 12:57:22 +02:00