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

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: pg9.4b1: unhelpful error message when creating a collation
Дата
Msg-id 20140525154511.GA21233@alap3.anarazel.de
обсуждение исходный текст
Ответ на pg9.4b1: unhelpful error message when creating a collation  (Fabien COELHO <coelho@cri.ensmp.fr>)
Ответы Re: pg9.4b1: unhelpful error message when creating a collation
Re: pg9.4b1: unhelpful error message when creating a collation
Список pgsql-hackers
Hi,

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
> 
> The collation creation fails, not sure why yet. However, the "error ..
> success" message is especially unhelpful.

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.

Using a debugger it's possible to see that in an earlier setlocale()
call errno is set correctly, but newlocale() then fails without setting
errno. The culprit seems to be some caching in glibc's _nl_find_locale().

I am not entirely sure why it's not reliably triggered < 9.4.

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.

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

Greetings,

Andres Freund

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Could not finish anti-wraparound VACUUM when stop limit is reached
Следующее
От: Jeff Davis
Дата:
Сообщение: [9.5] possible fast path for pinning a page multiple times