summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorAlvaro Herrera2022-12-12 10:13:26 +0000
committerAlvaro Herrera2022-12-12 10:13:26 +0000
commit840ff5f451cd9a391d237fc60894fea7ad82a189 (patch)
tree686fa56fde9f97fa0b044dbfb857ef1eaafed1ca /src/test
parent9d0cf574920f1d5e6c260815d242b6691d37d5dc (diff)
Get rid of recursion-marker values in enum AlterTableType
During ALTER TABLE execution, when prep-time handling of subcommands of certain types determine that execution-time handling requires recursion, they signal this by changing the subcommand type to a special value. This can be done in a simpler way by using a separate flag introduced by commit ec0925c22a3d, so do that. Catversion bumped. It's not clear to me that ALTER TABLE subcommands are stored anywhere in catalogs (CREATE FUNCTION rejects it in BEGIN ATOMIC function bodies), but we do have both write and read support for them, so be safe. Discussion: https://postgr.es/m/20220929090033.zxuaezcdwh2fgfjb@alvherre.pgsql
Diffstat (limited to 'src/test')
-rw-r--r--src/test/modules/test_ddl_deparse/test_ddl_deparse.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/src/test/modules/test_ddl_deparse/test_ddl_deparse.c b/src/test/modules/test_ddl_deparse/test_ddl_deparse.c
index 7e9e443306c..fa90b717489 100644
--- a/src/test/modules/test_ddl_deparse/test_ddl_deparse.c
+++ b/src/test/modules/test_ddl_deparse/test_ddl_deparse.c
@@ -114,9 +114,6 @@ get_altertable_subcmdinfo(PG_FUNCTION_ARGS)
case AT_AddColumn:
strtype = "ADD COLUMN";
break;
- case AT_AddColumnRecurse:
- strtype = "ADD COLUMN (and recurse)";
- break;
case AT_AddColumnToView:
strtype = "ADD COLUMN TO VIEW";
break;
@@ -156,9 +153,6 @@ get_altertable_subcmdinfo(PG_FUNCTION_ARGS)
case AT_DropColumn:
strtype = "DROP COLUMN";
break;
- case AT_DropColumnRecurse:
- strtype = "DROP COLUMN (and recurse)";
- break;
case AT_AddIndex:
strtype = "ADD INDEX";
break;
@@ -168,9 +162,6 @@ get_altertable_subcmdinfo(PG_FUNCTION_ARGS)
case AT_AddConstraint:
strtype = "ADD CONSTRAINT";
break;
- case AT_AddConstraintRecurse:
- strtype = "ADD CONSTRAINT (and recurse)";
- break;
case AT_ReAddConstraint:
strtype = "(re) ADD CONSTRAINT";
break;
@@ -183,18 +174,12 @@ get_altertable_subcmdinfo(PG_FUNCTION_ARGS)
case AT_ValidateConstraint:
strtype = "VALIDATE CONSTRAINT";
break;
- case AT_ValidateConstraintRecurse:
- strtype = "VALIDATE CONSTRAINT (and recurse)";
- break;
case AT_AddIndexConstraint:
strtype = "ADD CONSTRAINT (using index)";
break;
case AT_DropConstraint:
strtype = "DROP CONSTRAINT";
break;
- case AT_DropConstraintRecurse:
- strtype = "DROP CONSTRAINT (and recurse)";
- break;
case AT_ReAddComment:
strtype = "(re) ADD COMMENT";
break;
@@ -326,7 +311,10 @@ get_altertable_subcmdinfo(PG_FUNCTION_ARGS)
break;
}
- values[0] = CStringGetTextDatum(strtype);
+ if (subcmd->recurse)
+ values[0] = CStringGetTextDatum(psprintf("%s (and recurse)", strtype));
+ else
+ values[0] = CStringGetTextDatum(strtype);
if (OidIsValid(sub->address.objectId))
{
char *objdesc;