From 7a1bda44fa90d47f80455d5287b671fd604a4a70 Mon Sep 17 00:00:00 2001 From: Rahul Parande Date: Tue, 22 Jul 2025 07:10:55 +0000 Subject: [PATCH] Replace custom 'createOrAlter' field in ViewStmt with standard options list to distinguish T-SQL ALTER VIEW operations Signed-off-by: Rahul Parande --- src/backend/parser/gram.y | 4 ---- src/include/nodes/parsenodes.h | 3 --- 2 files changed, 7 deletions(-) diff --git a/src/backend/parser/gram.y b/src/backend/parser/gram.y index ed5e2b26857..1702fd80f2c 100644 --- a/src/backend/parser/gram.y +++ b/src/backend/parser/gram.y @@ -11245,7 +11245,6 @@ ViewStmt: CREATE OptTemp VIEW qualified_name opt_column_list opt_reloptions n->replace = false; n->options = $6; n->withCheckOption = $9; - n->createOrAlter = false; $$ = (Node *) n; } | CREATE OR REPLACE OptTemp VIEW qualified_name opt_column_list opt_reloptions @@ -11260,7 +11259,6 @@ ViewStmt: CREATE OptTemp VIEW qualified_name opt_column_list opt_reloptions n->replace = true; n->options = $8; n->withCheckOption = $11; - n->createOrAlter = false; $$ = (Node *) n; } | CREATE OptTemp RECURSIVE VIEW qualified_name '(' columnList ')' opt_reloptions @@ -11280,7 +11278,6 @@ ViewStmt: CREATE OptTemp VIEW qualified_name opt_column_list opt_reloptions (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("WITH CHECK OPTION not supported on recursive views"), parser_errposition(@12))); - n->createOrAlter = false; $$ = (Node *) n; } | CREATE OR REPLACE OptTemp RECURSIVE VIEW qualified_name '(' columnList ')' opt_reloptions @@ -11300,7 +11297,6 @@ ViewStmt: CREATE OptTemp VIEW qualified_name opt_column_list opt_reloptions (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("WITH CHECK OPTION not supported on recursive views"), parser_errposition(@14))); - n->createOrAlter = false; $$ = (Node *) n; } ; diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h index ef23f41864b..24ab45e7d30 100644 --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.h @@ -3782,9 +3782,6 @@ typedef struct ViewStmt bool replace; /* replace an existing view? */ List *options; /* options from WITH clause */ ViewCheckOption withCheckOption; /* WITH CHECK OPTION */ - bool createOrAlter; /* is query 'create view' or 'create or alter view' or 'alter view' */ - /* flag is set in gram-tsql-rule.y and gram.y */ - } ViewStmt; /* ----------------------