Remove extra check_stack_depth() from dropconstraint_internal()
authorAlexander Korotkov <[email protected]>
Wed, 21 Feb 2024 00:46:56 +0000 (02:46 +0200)
committerAlexander Korotkov <[email protected]>
Wed, 21 Feb 2024 00:51:41 +0000 (02:51 +0200)
The second check was added by d57b7cc33 without taking into account there
is already a check since b0f7dd915.

Reported-by: Ashutosh Bapat, Alexander Lakhin
Discussion: https://postgr.es/m/CAExHW5sBZWDjeBUFs_ehEDM%2BuhWxTiBkPbLiat7ZjWkb-DWQWw%40mail.gmail.com

src/backend/commands/tablecmds.c

index 679dee10da400d5d0be96644915d373b82e1125d..f79879455636e1cc5bfe600a9145e646c526e5aa 100644 (file)
@@ -12738,9 +12738,6 @@ dropconstraint_internal(Relation rel, HeapTuple constraintTup, DropBehavior beha
    /* Guard against stack overflow due to overly deep inheritance tree. */
    check_stack_depth();
 
-   /* since this function recurses, it could be driven to stack overflow */
-   check_stack_depth();
-
    /* At top level, permission check was done in ATPrepCmd, else do it */
    if (recursing)
        ATSimplePermissions(AT_DropConstraint, rel, ATT_TABLE | ATT_FOREIGN_TABLE);