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.