Improve reporting of newlocale() failures in CREATE COLLATION.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 20 Sep 2011 17:23:40 +0000 (13:23 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 20 Sep 2011 17:23:40 +0000 (13:23 -0400)
commit37d4fd2b9d331076292201ab988fe54f09640850
tree8f134783749663a954270f02ad5d5bab64b258d6
parentfaf5cee7f0189beba206a5d96c0abd8e4382b844
Improve reporting of newlocale() failures in CREATE COLLATION.

The standardized errno code for "no such locale" failures is ENOENT, which
we were just reporting at face value, viz "No such file or directory".
Per gripe from Thom Brown, this might confuse users, so add an errdetail
message to clarify what it means.  Also, report newlocale() failures as
ERRCODE_INVALID_PARAMETER_VALUE rather than using
errcode_for_file_access(), since newlocale()'s errno values aren't
necessarily tied directly to file access failures.
src/backend/utils/adt/pg_locale.c