postgresql/src/include
Noah Misch 14c57cb639 For inplace update durability, make heap_update() callers wait.
The previous commit fixed some ways of losing an inplace update.  It
remained possible to lose one when a backend working toward a
heap_update() copied a tuple into memory just before inplace update of
that tuple.  In catalogs eligible for inplace update, use LOCKTAG_TUPLE
to govern admission to the steps of copying an old tuple, modifying it,
and issuing heap_update().  This includes MERGE commands.  To avoid
changing most of the pg_class DDL, don't require LOCKTAG_TUPLE when
holding a relation lock sufficient to exclude inplace updaters.
Back-patch to v12 (all supported versions).  In v13 and v12, "UPDATE
pg_class" or "UPDATE pg_database" can still lose an inplace update.  The
v14+ UPDATE fix needs commit 86dc90056d,
and it wasn't worth reimplementing that fix without such infrastructure.

Reviewed by Nitin Motiani and (in earlier versions) Heikki Linnakangas.

Discussion: https://postgr.es/m/20231027214946.79.nmisch@google.com
2024-09-24 15:25:24 -07:00
..
access Fix data loss at inplace update after heap_update(). 2024-09-24 15:25:24 -07:00
bootstrap Update copyrights for 2020 2020-01-01 12:21:45 -05:00
catalog Cope with inplace update making catcache stale during TOAST fetch. 2024-06-27 19:21:13 -07:00
commands Back-patch "Refactor code in tablecmds.c to check and process tablespace moves" 2024-09-24 15:25:24 -07:00
common Fix corner-case 64-bit integer subtraction bug on some platforms. 2023-11-09 09:56:31 +00:00
datatype Update copyrights for 2020 2020-01-01 12:21:45 -05:00
executor Fix confusion about the return rowtype of SQL-language procedures. 2024-03-12 18:16:10 -04:00
fe_utils Move connect.h from fe_utils to src/include/common. 2020-08-10 09:22:58 -07:00
foreign Update copyrights for 2020 2020-01-01 12:21:45 -05:00
jit llvmjit: Use explicit LLVMContextRef for inlining 2023-11-17 11:46:31 +01:00
lib simplehash: Free collisions array in SH_STAT 2024-04-07 19:09:07 -07:00
libpq Fix handling of SCRAM-SHA-256's channel binding with RSA-PSS certificates 2023-02-15 10:12:36 +09:00
mb Fix incautious handling of possibly-miscoded strings in client code. 2021-06-07 14:15:25 -04:00
nodes Ensure we allocate NAMEDATALEN bytes for names in Index Only Scans 2024-05-01 13:23:05 +12:00
optimizer Account for optimized MinMax aggregates during SS_finalize_plan. 2024-05-18 14:31:35 -04:00
parser Avoid unnecessary plancache revalidation of utility statements. 2023-08-24 12:02:40 -04:00
partitioning Fix hash partition pruning with asymmetric partition sets. 2021-01-28 13:41:55 -05:00
port Fix fallback implementation for pg_atomic_test_set_flag(). 2023-11-15 15:04:43 -06:00
portability Update copyrights for 2020 2020-01-01 12:21:45 -05:00
postmaster Fix race condition between shutdown and unstarted background workers. 2020-12-24 17:00:43 -05:00
regex Cope with <regex.h> name clashes. 2024-07-06 10:39:10 +12:00
replication Fix possibility of logical decoding partial transaction changes. 2024-07-11 22:48:10 +09:00
rewrite Fix calculation of which GENERATED columns need to be updated. 2023-01-05 14:12:17 -05:00
snowball Update copyrights for 2020 2020-01-01 12:21:45 -05:00
statistics Initial pgindent and pgperltidy run for v13. 2020-05-14 13:06:50 -04:00
storage For inplace update durability, make heap_update() callers wait. 2024-09-24 15:25:24 -07:00
tcop Restrict accesses to non-system views and foreign tables during pg_dump. 2024-08-05 06:05:20 -07:00
tsearch Add comments and a missing CHECK_FOR_INTERRUPTS in ts_headline. 2022-11-21 17:07:07 -05:00
utils For inplace update durability, make heap_update() callers wait. 2024-09-24 15:25:24 -07:00
.gitignore Refactor dlopen() support 2018-09-06 11:33:04 +02:00
c.h perl: Hide warnings inside perl.h when using gcc compatible compiler 2023-01-02 15:50:33 -08:00
fmgr.h Fix minor violations of FunctionCallInvoke usage protocol. 2020-04-21 14:23:53 -04:00
funcapi.h Avoid holding a directory FD open across assorted SRF calls. 2020-03-16 21:05:52 -04:00
getaddrinfo.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
getopt_long.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
Makefile Get rid of jsonpath_gram.h and jsonpath_scanner.h 2019-03-20 11:13:34 +03:00
miscadmin.h Get rid of artificial restriction on hash table sizes on Windows. 2021-07-25 14:02:27 -04:00
pg_config.h.in Fix macro placement in pg_config.h.in 2024-07-26 14:16:40 +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_manual.h Fix concurrency issues with WAL segment recycling on Windows 2021-03-22 14:02:36 +09:00
pg_getopt.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
pg_trace.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
pgstat.h Fix waiting in RegisterSyncRequest(). 2022-03-16 15:37:15 +13:00
pgtar.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
pgtime.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
port.h Make EXEC_BACKEND more convenient on Linux and FreeBSD. 2023-02-08 13:09:49 +09:00
postgres.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
postgres_ext.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
postgres_fe.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
rusagestub.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00
windowapi.h Update copyrights for 2020 2020-01-01 12:21:45 -05:00