Re: [COMMITTERS] pgsql: Add function to import operating system collations - Mailing list pgsql-committers

From Tom Lane
Subject Re: [COMMITTERS] pgsql: Add function to import operating system collations
Date
Msg-id 19773.1484761021@sss.pgh.pa.us
Whole thread Raw
In response to Re: [COMMITTERS] pgsql: Add function to import operating systemcollations  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Responses Re: [COMMITTERS] pgsql: Add function to import operating system collations
List pgsql-committers
Peter Eisentraut <peter.eisentraut@2ndquadrant.com> writes:
> What's fishy about this is that I can't reproduce it locally in a
> variety of VMs, and the buildfarm is not unanimous either.

Well, as I said, I get

$ locale -a | grep ^aa_ER
aa_ER
aa_ER.utf8
aa_ER.utf8@saaho
aa_ER@saaho

What it looks like to me is that we see "aa_ER.utf8@saaho", enter
that, strip it to "aa_ER@saaho" and enter that (if_not_exists,
which it doesn't), and then see "aa_ER@saaho" which we try to
enter and fail.  IOW, the behavior is dependent on the order in
which "locale -a" returns the names, which I already mentioned
I do not think we should trust to be consistent.

The previous coding applied a sort so as not to depend on what
order "locale -a" had returned things in, and I think we need
to retain that.  At the very least, all the normalized names
need to be saved up and entered in a second pass.

            regards, tom lane


pgsql-committers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [COMMITTERS] pgsql: Add function to import operating systemcollations
Next
From: Tom Lane
Date:
Subject: Re: [COMMITTERS] pgsql: Add function to import operating system collations