projects
/
postgresql.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
10932ed
)
Fix ALTER COLLATION "default" REFRESH VERSION.
author
Jeff Davis
<
[email protected]
>
Sat, 29 Oct 2022 21:13:23 +0000
(14:13 -0700)
committer
Jeff Davis
<
[email protected]
>
Mon, 31 Oct 2022 22:44:52 +0000
(15:44 -0700)
Issue a helpful error message rather than an internal error.
Discussion: https://postgr.es/m/
51fb77507cafd43fc1a2e733c23045873d93ae60
.camel%40j-davis.com
Reviewed-by: Thomas Munro
src/backend/commands/collationcmds.c
patch
|
blob
|
blame
|
history
diff --git
a/src/backend/commands/collationcmds.c
b/src/backend/commands/collationcmds.c
index 23468cf79da55129230e5128918d6adb00ac8d63..86fbc7fa019f96dd73fbca83814787533b2c1cc3 100644
(file)
--- a/
src/backend/commands/collationcmds.c
+++ b/
src/backend/commands/collationcmds.c
@@
-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));