Skip site navigation (1) Skip section navigation (2)

Re: File not found error on creating collation

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Marti Raudsepp <marti(at)juffo(dot)org>
Cc: Thom Brown <thom(at)linux(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: File not found error on creating collation
Date: 2011-09-20 02:04:25
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Marti Raudsepp <marti(at)juffo(dot)org> writes:
> On Tue, Sep 20, 2011 at 03:24, Thom Brown <thom(at)linux(dot)com> wrote:
>> ERROR: could not create locale "sr_SB.utf8": No such file or directory
>> It's correct in that it shouldn't be able to create the locale since
>> it's not installed, but what file can't it find? What is the user
>> supposed to do with this message?

> Unfortunately locales are OS-specific so there's not much universal
> advice that Postgres could give.

The reason it's doing that is that newlocale() is returning ENOENT,
which is what it's supposed to do according to the standard:


	The newlocale() function shall fail if:

	There is not enough memory available to create the locale object or load the locale data.
	The category_mask contains a bit that does not correspond to a valid category.
	For any of the categories in category_mask, the locale data is not available.

The generic meaning of ENOENT is "file not found", and at some level
this probably *is* a file-not-found situation, but Postgres has no way
to know which file is missing.

We could possibly add a HINT suggesting that the locale isn't installed,
but I don't see that we could offer any useful generic advice about how
to install it.  I'm also worried about how to phrase the hint to cover
some other obvious possibilities, like "you fat-fingered the locale

			regards, tom lane

In response to


pgsql-hackers by date

Next:From: Tom LaneDate: 2011-09-20 02:51:32
Subject: Re: Inlining comparators as a performance optimisation
Previous:From: Peter GeogheganDate: 2011-09-20 01:56:01
Subject: Inlining comparators as a performance optimisation

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group