mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
Correct the command tags for ALTER ... RENAME COLUMN.
Previously ALTER MATERIALIZED VIEW / FOREIGN TABLE ... RENAME COLUMN ... returned "ALTER TABLE" as a command tag. This commit fixes them so that they return "ALTER MATERIALIZED VIEW" and "ALTER FOREIGN TABLE" as command tags, respectively. This issue exists in all supported versions, but we don't back-patch this because it's not enough of a bug to justify taking any compatibility risks for. Otherwise, the back-patch would cause minor version update to break, for example, the existing event trigger functions using TG_TAG. Author: Fujii Masao Reviewed-by: Ibrar Ahmed Discussion: https://postgr.es/m/CAHGQGwGUaC03FFdTFoHsCuDrrNvFvNVQ6xyd40==P25WvuBJjg@mail.gmail.com
This commit is contained in:
@ -2399,7 +2399,14 @@ CreateCommandTag(Node *parsetree)
|
||||
break;
|
||||
|
||||
case T_RenameStmt:
|
||||
tag = AlterObjectTypeCommandTag(((RenameStmt *) parsetree)->renameType);
|
||||
/*
|
||||
* When the column is renamed, the command tag is created
|
||||
* from its relation type
|
||||
*/
|
||||
tag = AlterObjectTypeCommandTag(
|
||||
((RenameStmt *) parsetree)->renameType == OBJECT_COLUMN ?
|
||||
((RenameStmt *) parsetree)->relationType :
|
||||
((RenameStmt *) parsetree)->renameType);
|
||||
break;
|
||||
|
||||
case T_AlterObjectDependsStmt:
|
||||
|
Reference in New Issue
Block a user