Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc4325ce

Browse files
committed
Fold AlterForeignTableStmt into AlterTableStmt
All other relation types are handled by AlterTableStmt, so it'sunnecessary to make a different statement for foreign tables.Discussion:https://www.postgresql.org/message-id/flat/163c00a5-f634-ca52-fc7c-0e53deda8735%402ndquadrant.com
1 parentc2bd1fe commitc4325ce

File tree

1 file changed

+21
-32
lines changed

1 file changed

+21
-32
lines changed

‎src/backend/parser/gram.y

Lines changed: 21 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ static Node *makeRecursiveViewSelect(char *relname, List *aliases, Node *query);
259259
AlterFdwStmtAlterForeignServerStmtAlterGroupStmt
260260
AlterObjectDependsStmtAlterObjectSchemaStmtAlterOwnerStmt
261261
AlterOperatorStmtAlterTypeStmtAlterSeqStmtAlterSystemStmtAlterTableStmt
262-
AlterTblSpcStmtAlterExtensionStmtAlterExtensionContentsStmtAlterForeignTableStmt
262+
AlterTblSpcStmtAlterExtensionStmtAlterExtensionContentsStmt
263263
AlterCompositeTypeStmtAlterUserMappingStmt
264264
AlterRoleStmtAlterRoleSetStmtAlterPolicyStmtAlterStatsStmt
265265
AlterDefaultPrivilegesStmtDefACLAction
@@ -850,7 +850,6 @@ stmt :
850850
|AlterExtensionContentsStmt
851851
|AlterFdwStmt
852852
|AlterForeignServerStmt
853-
|AlterForeignTableStmt
854853
|AlterFunctionStmt
855854
|AlterGroupStmt
856855
|AlterObjectDependsStmt
@@ -1836,9 +1835,9 @@ DiscardStmt:
18361835

18371836
/*****************************************************************************
18381837
*
1839-
*ALTER [ TABLE | INDEX | SEQUENCE | VIEW | MATERIALIZED VIEW ] variations
1838+
*ALTER [ TABLE | INDEX | SEQUENCE | VIEW | MATERIALIZED VIEW| FOREIGN TABLE] variations
18401839
*
1841-
* Note: we accept all subcommands for each of thefivevariants, and sort
1840+
* Note: we accept all subcommands for each of the variants, and sort
18421841
* out what's really legal at execution time.
18431842
*****************************************************************************/
18441843

@@ -2026,6 +2025,24 @@ AlterTableStmt:
20262025
n->nowait =$14;
20272026
$$ = (Node *)n;
20282027
}
2028+
|ALTERFOREIGNTABLErelation_expralter_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+
|ALTERFOREIGNTABLEIF_PEXISTSrelation_expralter_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+
}
20292046
;
20302047

20312048
alter_table_cmds:
@@ -5111,34 +5128,6 @@ CreateForeignTableStmt:
51115128
}
51125129
;
51135130

5114-
/*****************************************************************************
5115-
*
5116-
*QUERY:
5117-
* ALTER FOREIGN TABLE relname [...]
5118-
*
5119-
*****************************************************************************/
5120-
5121-
AlterForeignTableStmt:
5122-
ALTERFOREIGNTABLErelation_expralter_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-
|ALTERFOREIGNTABLEIF_PEXISTSrelation_expralter_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-
51425131
/*****************************************************************************
51435132
*
51445133
*QUERY:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp