1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-07 00:36:50 +03:00

Disallow ALTER DOMAIN on non-domain type everywhere

This has been the behavior already in most cases, but through
omission, ALTER DOMAIN / OWNER TO and ALTER DOMAIN / SET SCHEMA would
silently work on non-domain types as well.
This commit is contained in:
Peter Eisentraut
2012-01-27 21:20:34 +02:00
parent 8137f2c323
commit 2787458362
3 changed files with 20 additions and 6 deletions

View File

@ -213,7 +213,7 @@ ExecAlterObjectSchemaStmt(AlterObjectSchemaStmt *stmt)
case OBJECT_TYPE:
case OBJECT_DOMAIN:
AlterTypeNamespace(stmt->object, stmt->newschema);
AlterTypeNamespace(stmt->object, stmt->newschema, stmt->objectType);
break;
default:
@ -510,7 +510,7 @@ ExecAlterOwnerStmt(AlterOwnerStmt *stmt)
case OBJECT_TYPE:
case OBJECT_DOMAIN: /* same as TYPE */
AlterTypeOwner(stmt->object, newowner);
AlterTypeOwner(stmt->object, newowner, stmt->objectType);
break;
case OBJECT_TSDICTIONARY: