Re: Allow tailoring of ICU locales with custom rules - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: Allow tailoring of ICU locales with custom rules
Date
Msg-id 5c09a150-cb73-39ba-28a3-3f4abebbcf49@enterprisedb.com
Whole thread Raw
In response to Re: Allow tailoring of ICU locales with custom rules  ("Daniel Verite" <daniel@manitou-mail.org>)
Responses Re: Allow tailoring of ICU locales with custom rules
List 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

pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: run pgindent on a regular basis / scripted manner
Next
From: Andrew Dunstan
Date:
Subject: Re: OpenSSL 3.0.0 vs old branches