Skip to content

Commit 544b452

Browse files
committed
Disallow specifying ICU rules unless locale provider is ICU
Follow-up for 30a53b7; this was not checked in all cases. Reported-by: Jeff Davis <pgsql@j-davis.com>
1 parent b6dfee2 commit 544b452

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/backend/commands/collationcmds.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,11 @@ DefineCollation(ParseState *pstate, List *names, List *parameters, bool if_not_e
271271
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
272272
errmsg("nondeterministic collations not supported with this provider")));
273273

274+
if (collicurules && collprovider != COLLPROVIDER_ICU)
275+
ereport(ERROR,
276+
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
277+
errmsg("ICU rules cannot be specified unless locale provider is ICU")));
278+
274279
if (collprovider == COLLPROVIDER_ICU)
275280
{
276281
#ifdef USE_ICU

src/backend/commands/dbcommands.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1066,6 +1066,11 @@ createdb(ParseState *pstate, const CreatedbStmt *stmt)
10661066
ereport(ERROR,
10671067
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
10681068
errmsg("ICU locale cannot be specified unless locale provider is ICU")));
1069+
1070+
if (dbicurules)
1071+
ereport(ERROR,
1072+
(errcode(ERRCODE_INVALID_OBJECT_DEFINITION),
1073+
errmsg("ICU rules cannot be specified unless locale provider is ICU")));
10691074
}
10701075

10711076
/*

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