@@ -259,7 +259,7 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
259
259
AlterFdwStmt AlterForeignServerStmt AlterGroupStmt
260
260
AlterObjectDependsStmt AlterObjectSchemaStmt AlterOwnerStmt
261
261
AlterOperatorStmt AlterTypeStmt AlterSeqStmt AlterSystemStmt AlterTableStmt
262
- AlterTblSpcStmt AlterExtensionStmt AlterExtensionContentsStmt AlterForeignTableStmt
262
+ AlterTblSpcStmt AlterExtensionStmt AlterExtensionContentsStmt
263
263
AlterCompositeTypeStmt AlterUserMappingStmt
264
264
AlterRoleStmt AlterRoleSetStmt AlterPolicyStmt AlterStatsStmt
265
265
AlterDefaultPrivilegesStmt DefACLAction
@@ -850,7 +850,6 @@ stmt :
850
850
| AlterExtensionContentsStmt
851
851
| AlterFdwStmt
852
852
| AlterForeignServerStmt
853
- | AlterForeignTableStmt
854
853
| AlterFunctionStmt
855
854
| AlterGroupStmt
856
855
| AlterObjectDependsStmt
@@ -1836,9 +1835,9 @@ DiscardStmt:
1836
1835
1837
1836
/* ****************************************************************************
1838
1837
*
1839
- * ALTER [ TABLE | INDEX | SEQUENCE | VIEW | MATERIALIZED VIEW ] variations
1838
+ * ALTER [ TABLE | INDEX | SEQUENCE | VIEW | MATERIALIZED VIEW | FOREIGN TABLE ] variations
1840
1839
*
1841
- * Note: we accept all subcommands for each of the five variants, and sort
1840
+ * Note: we accept all subcommands for each of the variants, and sort
1842
1841
* out what's really legal at execution time.
1843
1842
*****************************************************************************/
1844
1843
@@ -2026,6 +2025,24 @@ AlterTableStmt:
2026
2025
n->nowait = $14 ;
2027
2026
$$ = (Node *)n;
2028
2027
}
2028
+ | ALTER FOREIGN TABLE relation_expr alter_table_cmds
2029
+ {
2030
+ AlterTableStmt *n = makeNode(AlterTableStmt);
2031
+ n->relation = $4 ;
2032
+ n->cmds = $5 ;
2033
+ n->relkind = OBJECT_FOREIGN_TABLE;
2034
+ n->missing_ok = false ;
2035
+ $$ = (Node *)n;
2036
+ }
2037
+ | ALTER FOREIGN TABLE IF_P EXISTS relation_expr alter_table_cmds
2038
+ {
2039
+ AlterTableStmt *n = makeNode(AlterTableStmt);
2040
+ n->relation = $6 ;
2041
+ n->cmds = $7 ;
2042
+ n->relkind = OBJECT_FOREIGN_TABLE;
2043
+ n->missing_ok = true ;
2044
+ $$ = (Node *)n;
2045
+ }
2029
2046
;
2030
2047
2031
2048
alter_table_cmds :
@@ -5111,34 +5128,6 @@ CreateForeignTableStmt:
5111
5128
}
5112
5129
;
5113
5130
5114
- /* ****************************************************************************
5115
- *
5116
- * QUERY:
5117
- * ALTER FOREIGN TABLE relname [...]
5118
- *
5119
- *****************************************************************************/
5120
-
5121
- AlterForeignTableStmt :
5122
- ALTER FOREIGN TABLE relation_expr alter_table_cmds
5123
- {
5124
- AlterTableStmt *n = makeNode(AlterTableStmt);
5125
- n->relation = $4 ;
5126
- n->cmds = $5 ;
5127
- n->relkind = OBJECT_FOREIGN_TABLE;
5128
- n->missing_ok = false ;
5129
- $$ = (Node *)n;
5130
- }
5131
- | ALTER FOREIGN TABLE IF_P EXISTS relation_expr alter_table_cmds
5132
- {
5133
- AlterTableStmt *n = makeNode(AlterTableStmt);
5134
- n->relation = $6 ;
5135
- n->cmds = $7 ;
5136
- n->relkind = OBJECT_FOREIGN_TABLE;
5137
- n->missing_ok = true ;
5138
- $$ = (Node *)n;
5139
- }
5140
- ;
5141
-
5142
5131
/* ****************************************************************************
5143
5132
*
5144
5133
* QUERY:
0 commit comments