Re: Allow tailoring of ICU locales with custom rules

From: Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>
To: Daniel Verite <daniel(at)manitou-mail(dot)org>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Cc: vignesh C <vignesh21(at)gmail(dot)com>, Pgsql-Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Allow tailoring of ICU locales with custom rules
Date: 2023-02-06 21:16:34
Message-ID: 5c09a150-cb73-39ba-28a3-3f4abebbcf49@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 04.02.23 14:41, Daniel Verite wrote:
> However it still leaves "daticurules" empty in the destination db,
> because of an actual bug in the current patch.
>
> Looking at createdb() in commands.c, it creates this variable:
>
> @@ -711,6 +714,7 @@ createdb(ParseState *pstate, const CreatedbStmt *stmt)
> char *dbcollate = NULL;
> char *dbctype = NULL;
> char *dbiculocale = NULL;
> + char *dbicurules = NULL;
> char dblocprovider = '\0';
> char *canonname;
> int encoding = -1;
>
> and then reads it later
>
> @@ -1007,6 +1017,8 @@ createdb(ParseState *pstate, const CreatedbStmt *stmt)
> dblocprovider = src_locprovider;
> if (dbiculocale == NULL && dblocprovider == COLLPROVIDER_ICU)
> dbiculocale = src_iculocale;
> + if (dbicurules == NULL && dblocprovider == COLLPROVIDER_ICU)
> + dbicurules = src_icurules;
>
> /* Some encodings are client only */
> if (!PG_VALID_BE_ENCODING(encoding))
>
> but it forgets to assign it in between, so it stays NULL and src_icurules
> is taken instead.

Right. Here is a new patch with this fixed.

Attachment Content-Type Size
v4-0001-Allow-tailoring-of-ICU-locales-with-custom-rules.patch text/plain 23.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2023-02-06 21:19:30 Re: OpenSSL 3.0.0 vs old branches
Previous Message Andrew Dunstan 2023-02-06 21:13:24 Re: run pgindent on a regular basis / scripted manner