Re: pg9.4b1: unhelpful error message when creating a collation

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>, PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg9.4b1: unhelpful error message when creating a collation
Date: 2014-05-25 18:09:26
Message-ID: 12267.1401041366@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> On 2014-05-25 09:17:24 +0200, Fabien COELHO wrote:
>> sql> CREATE COLLATION "french" (locale='fr_FR.utf8');
>> ERROR: could not create locale "fr_FR.utf8": Success

> This seems to be a glibc bug. If a nonexistant locale has already been
> asked for errno is set to 0 instead of something sensible.
> Searching for that error turned up:
> https://sourceware.org/bugzilla/show_bug.cgi?id=14247
> https://bugzilla.redhat.com/show_bug.cgi?id=827510
> The latter by Tom Lane ;). Unfortunately not much seems to have happened
> since.

Yeah. Red Hat seems to be carrying a patch (the RH bugzilla says it
was fixed in Fedora 17, and I see correct behavior in current RHEL6)
but if the sourceware bug reflects the state of affairs upstream then
other distros may still be suffering from the bug.

> Except badgering the glibc guys a bit, the only thing I can think of is
> to fudge errno = 0 into errno = ENOENT. Not nice.

Yeah, I don't especially care for adding such a workaround. If the
consequences were worse than a wrong error message, then maybe ---
but adding the workaround might itself sometimes mean a wrong error
message, so it's not clear we'd be making much forward progress.

Better to pester the glibc boys to fix it properly. In the meantime,
you might have some luck asking the Ubuntu packagers to copy Red Hat's
fix.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2014-05-25 18:16:46 Re: [9.5] possible fast path for pinning a page multiple times
Previous Message Andres Freund 2014-05-25 17:44:47 Re: pg_upgrade fails: Mismatch of relation OID in database 8.4 -> 9.3