]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Add stack depth check to QueueFKConstraintValidation().
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 26 May 2026 15:58:25 +0000 (11:58 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 26 May 2026 15:58:25 +0000 (11:58 -0400)
commit0480d84ee35f386d3d78b58488303f9f6ba1b4c2
treeee2259c60061df69a2f69f5e630797a61ea181ed
parente7544c518ab0943fc85e2a4b44df9f7561ad2d0c
Add stack depth check to QueueFKConstraintValidation().

QueueFKConstraintValidation() recurses through the partition hierarchy
to queue child constraint validations and to mark child rows as
validated.  With a sufficiently deep partition tree, this can result
in a stack-overflow crash.  Defend against that as we do elsewhere.

Bug: #19482
Reported-by: Alexander Lakhin <exclusion@gmail.com>
Author: Ayush Tiwari <ayushtiwari.slg01@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/19482-4cc37cbf52d55235@postgresql.org
Backpatch-through: 18
src/backend/commands/tablecmds.c