Skip to content

Commit 0717f2f

Browse files
committed
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
1 parent 10932ed commit 0717f2f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/backend/commands/collationcmds.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,11 @@ AlterCollation(AlterCollationStmt *stmt)
366366
rel = table_open(CollationRelationId, RowExclusiveLock);
367367
collOid = get_collation_oid(stmt->collname, false);
368368

369+
if (collOid == DEFAULT_COLLATION_OID)
370+
ereport(ERROR,
371+
(errmsg("cannot refresh version of default collation"),
372+
errhint("Use ALTER DATABASE ... REFRESH COLLATION VERSION instead.")));
373+
369374
if (!pg_collation_ownercheck(collOid, GetUserId()))
370375
aclcheck_error(ACLCHECK_NOT_OWNER, OBJECT_COLLATION,
371376
NameListToString(stmt->collname));

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy