pgsql: Add stack depth check to QueueFKConstraintValidation(). - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Add stack depth check to QueueFKConstraintValidation().
Date
Msg-id E1wRuAr-001DQt-09@gemulon.postgresql.org
Whole thread
List pgsql-committers
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

Branch
------
REL_18_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/0480d84ee35f386d3d78b58488303f9f6ba1b4c2

Modified Files
--------------
src/backend/commands/tablecmds.c | 3 +++
1 file changed, 3 insertions(+)


pgsql-committers by date:

Previous
From: Álvaro Herrera
Date:
Subject: pgsql: Restructure repack worker teardown
Next
From: Amit Kapila
Date:
Subject: pgsql: Fix memory accumulation in pg_sync_replication_slots() during re