postgresql/src/include
Noah Misch fd27b878c2 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:21 -07:00
..
access Fix data loss at inplace update after heap_update(). 2024-09-24 15:25:21 -07:00
archive Add macro for customizing an archiving WARNING message. 2024-03-04 15:41:42 -06:00
backup Align blocks in incremental backups to BLCKSZ 2024-04-05 16:30:01 +02:00
bootstrap Update copyright for 2024 2024-01-03 20:49:05 -05:00
catalog Do not summarize WAL if generated with wal_level=minimal. 2024-07-18 12:19:29 -04:00
commands When creating materialized views, use REFRESH to load data. 2024-07-16 15:41:22 -07:00
common parse_manifest: Use const char * 2024-06-21 07:53:30 +02:00
datatype Update copyright for 2024 2024-01-03 20:49:05 -05:00
executor SQL/JSON: Fix casting for integer EXISTS columns in JSON_TABLE 2024-07-30 10:39:28 +09:00
fe_utils Allow dbname to be written as part of connstring via pg_basebackup's -R option. 2024-03-21 10:50:33 +05:30
foreign Clean up more indent breakage from 6377e12a5. 2024-04-16 13:00:40 -04:00
jit Move resowner from common JitContext to LLVM specific 2024-07-19 10:27:54 +03:00
lib Prevent access of uninitialized memory in radix tree nodes 2024-06-21 17:29:39 +07:00
libpq Use PqMsg_* macros in more places. 2024-07-17 10:51:00 -05:00
mb Inline basic UTF-8 functions. 2024-03-20 09:40:57 -07:00
nodes Update comment about ExprState.escontext 2024-09-06 12:01:49 +09:00
optimizer Fix asymmetry in setting EquivalenceClass.ec_sortref 2024-06-06 13:41:34 +03:00
parser Revert support for ALTER TABLE ... MERGE/SPLIT PARTITION(S) commands 2024-08-24 19:18:24 +03:00
partitioning Revert support for ALTER TABLE ... MERGE/SPLIT PARTITION(S) commands 2024-08-24 19:18:24 +03:00
pch Update copyright for 2024 2024-01-03 20:49:05 -05:00
port Remove bogus assertion in pg_atomic_monotonic_advance_u64 2024-07-04 13:25:31 +02:00
portability Update copyright for 2024 2024-01-03 20:49:05 -05:00
postmaster Wait for WAL summarization to catch up before creating .partial file. 2024-07-26 14:51:10 -04:00
regex Cope with <regex.h> name clashes. 2024-07-06 11:23:40 +12:00
replication Fix possibility of logical decoding partial transaction changes. 2024-07-11 22:48:21 +09:00
rewrite Support MERGE into updatable views. 2024-02-29 15:56:59 +00:00
snowball Update copyright for 2024 2024-01-03 20:49:05 -05:00
statistics Update copyright for 2024 2024-01-03 20:49:05 -05:00
storage Allow ReadStream to be consumed as raw block numbers. 2024-09-18 11:29:58 +12:00
tcop Restrict accesses to non-system views and foreign tables during pg_dump. 2024-08-05 06:05:30 -07:00
tsearch Update copyright for 2024 2024-01-03 20:49:05 -05:00
utils Revert support for ALTER TABLE ... MERGE/SPLIT PARTITION(S) commands 2024-08-24 19:18:24 +03:00
.gitignore Refactor dlopen() support 2018-09-06 11:33:04 +02:00
c.h Add macro to disable address safety instrumentation 2024-04-06 12:20:40 +07:00
fmgr.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
funcapi.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
getopt_long.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
Makefile Put genbki.pl output into src/include/catalog/ directly 2024-03-14 07:11:21 +01:00
meson.build meson: Restore implicit warning/debug/optimize flags for extensions 2024-06-07 09:36:26 +02:00
miscadmin.h Remove assertions that some compiler say are tautological 2024-03-20 09:14:51 +02:00
pg_config.h.in Fix macro placement in pg_config.h.in 2024-07-26 16:25:56 +02:00
pg_config_ext.h.in Autoconfiscate selection of 64-bit int type for 64-bit large object API. 2012-10-07 21:52:43 -04:00
pg_config_ext.h.meson meson: Add initial version of meson based build system 2022-09-21 22:37:17 -07:00
pg_config_manual.h Introduce a non-recursive JSON parser 2024-04-04 06:46:40 -04:00
pg_getopt.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
pg_trace.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
pgstat.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
pgtar.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
pgtime.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
port.h Replace calls to pg_qsort() with the qsort() macro. 2024-02-16 11:37:50 -06:00
postgres.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
postgres_ext.h Move RelFileNumber declarations to common/relpath.h. 2022-09-27 12:01:57 -04:00
postgres_fe.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
varatt.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
windowapi.h Update copyright for 2024 2024-01-03 20:49:05 -05:00