Back-patch "Refactor code in tablecmds.c to check and process tablespace moves"
authorNoah Misch <[email protected]>
Tue, 24 Sep 2024 22:25:24 +0000 (15:25 -0700)
committerNoah Misch <[email protected]>
Tue, 24 Sep 2024 22:25:24 +0000 (15:25 -0700)
commit1299564cb9c787de3068777eaf8440fd0fceca4a
tree056b5aae034cf0c546a3b6c9cc5383631df97cce
parente43e71b6cd2f440e84da8a4a245837afba28b84f
Back-patch "Refactor code in tablecmds.c to check and process tablespace moves"

Back-patch commits 4c9c359d38ff1e2de388eedd860785be6a49201c and
24843297a96d7be16cc3f4b090aacfc6e5e6839e to v13 and v12.  Before those
commits, we held the modifiable copy of the relation's pg_class row
throughout a table_relation_copy_data().  That can last long enough to
copy MaxBlockNumber of data.  A subsequent fix will hold LockTuple() for
the lifespan of that modifiable copy.  By back-patching this first, we
avoid a needless long-duration LOCKTAG_TUPLE.

Discussion: https://postgr.es/m/20231027214946[email protected]
src/backend/commands/tablecmds.c
src/include/commands/tablecmds.h