Re: pgsql: Add function to import operating system collations

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: Add function to import operating system collations
Date: 2017-01-18 17:37:01
Message-ID: 19773.1484761021@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)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(dot)utf8(at)saaho
aa_ER(at)saaho

What it looks like to me is that we see "aa_ER(dot)utf8(at)saaho", enter
that, strip it to "aa_ER(at)saaho" and enter that (if_not_exists,
which it doesn't), and then see "aa_ER(at)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

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2017-01-18 17:48:33 Re: pgsql: Add function to import operating system collations
Previous Message Peter Eisentraut 2017-01-18 17:26:40 Re: pgsql: Add function to import operating system collations

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2017-01-18 17:42:39 Re: increasing the default WAL segment size
Previous Message Peter Eisentraut 2017-01-18 17:26:40 Re: pgsql: Add function to import operating system collations