postgresql/src
Álvaro Herrera 1b216fceff
Fix some more bugs in foreign keys connecting partitioned tables
* In DetachPartitionFinalize() we were applying a tuple conversion map
  to tuples that didn't need one, which can lead to erratic behavior if
  a partitioned table has a partition with a different column order, as
  reported by Alexander Lakhin. This was introduced by 53af9491a0.
  Don't do that.  Also, modify a recently added test case to exercise
  this.

* The same function as well as CloneFkReferenced() were acquiring
  AccessShareLock on a partition, only to have CreateTrigger() later
  acquire ShareRowExclusiveLock on it.  This can lead to deadlock by
  lock escalation, unnecessarily.  Avoid that by acquiring the stronger
  lock to begin with.  This probably dates back to branch 12, but I have
  never seen a report of this being a problem in the field.

* Innocuous but wasteful: also introduced by 53af9491a0, we were
  reading a pg_constraint tuple from syscache that we don't need, as
  reported by Tender Wang.  Don't.

Backpatch to 15.

Discussion: https://postgr.es/m/461e9c26-2076-8224-e119-84998b6a784e@gmail.com
2024-10-30 10:54:03 +01:00
..
backend Fix some more bugs in foreign keys connecting partitioned tables 2024-10-30 10:54:03 +01:00
bin vacuumdb: Schema-qualify operator in catalog query's WHERE clause. 2024-10-07 16:49:20 -05:00
common Guard against enormously long input in pg_saslprep(). 2024-10-28 14:33:55 -04:00
fe_utils Prevent mis-encoding of "trailing junk after numeric literal" errors. 2024-09-05 12:42:33 -04:00
include Unpin buffer before inplace update waits for an XID to end. 2024-10-29 09:39:59 -07:00
interfaces ecpg: Fix out-of-bound read in DecodeDateTime() 2024-10-23 08:35:04 +09:00
makefiles Refactor DLSUFFIX handling 2022-03-25 08:56:02 +01:00
pl Further refine _SPI_execute_plan's rule for atomic execution. 2024-10-16 17:36:29 -04:00
port Fix overflow in bsearch_arg() with more than INT_MAX elements 2024-10-28 14:08:00 +02:00
template On NetBSD, force dynamic symbol resolution at postmaster start. 2022-08-30 17:28:55 -04:00
test Fix some more bugs in foreign keys connecting partitioned tables 2024-10-30 10:54:03 +01:00
timezone Update time zone data files to tzdata release 2024b. 2024-10-29 11:50:00 -04:00
tools For inplace update, send nontransactional invalidations. 2024-10-25 06:51:07 -07:00
tutorial Doc: sync src/tutorial/basics.source with SGML documentation. 2022-11-19 13:09:14 -05:00
.gitignore
DEVELOPERS
Makefile
Makefile.global.in Suppress macOS warnings about duplicate libraries in link commands. 2023-09-29 14:07:30 -04:00
Makefile.shlib Stop using "-multiply_defined suppress" on macOS. 2023-09-26 21:06:21 -04:00
nls-global.mk Improve frontend error logging style. 2022-04-08 14:55:14 -04:00