mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-06 15:24:56 +08:00
Fix ALTER COLLATION "default" REFRESH VERSION.
Issue a helpful error message rather than an internal error. Discussion: https://postgr.es/m/51fb77507cafd43fc1a2e733c23045873d93ae60.camel%40j-davis.com Reviewed-by: Thomas Munro
This commit is contained in:
parent
10932ed5e5
commit
0717f2fedb
@ -366,6 +366,11 @@ AlterCollation(AlterCollationStmt *stmt)
|
||||
rel = table_open(CollationRelationId, RowExclusiveLock);
|
||||
collOid = get_collation_oid(stmt->collname, false);
|
||||
|
||||
if (collOid == DEFAULT_COLLATION_OID)
|
||||
ereport(ERROR,
|
||||
(errmsg("cannot refresh version of default collation"),
|
||||
errhint("Use ALTER DATABASE ... REFRESH COLLATION VERSION instead.")));
|
||||
|
||||
if (!pg_collation_ownercheck(collOid, GetUserId()))
|
||||
aclcheck_error(ACLCHECK_NOT_OWNER, OBJECT_COLLATION,
|
||||
NameListToString(stmt->collname));
|
||||
|
Loading…
Reference in New Issue
Block a user