* Tom Lane <tgl@sss.pgh.pa.us> [gmane.comp.db.postgresql.devel.general]:
> Andreas Krennmair <netnews@synflood.at> writes:
> > creating template1 database in data/base/1 ... FATAL: XX000: failed to
> > initialize lc_monetary to "C"
> > LOCATION: InitializeGUCOptions, guc.c:2337
> > child process exited with exit code 1
>
> > As an important note you have to know that diet libc's support for all
> > the NLS and i18n/l10n-related stuff is largely incomplete and works so
> > far that common software compiles and runs
>
> [ shrug ] If it returns an error when someone tries to set the locale
> to "C", that is *not* a good-enough implementation of the ANSI/ISO C
> standard. Fix the library.
[x] Done. :-)
I did some research and submitted a patch to diet libc, the only other
issue that I had with PostgreSQL was a minor one, which I fixed with a
small patch to PostgreSQL:
http://synflood.at/patches/pgsql-diet.diff
The first fix is that PostgreSQL relies on that, when reading the output
of postgres -V, all the output can be read with a single read call (or
whatever call is used, it comes down to read(2) in the end) when called
from initdb. This is not the case with diet libc, as the puts
implementation in diet libc does two write calls, with the second write
call happening with a closed pipe. Changing the puts to printf removes
this problem, optionally you could change the format string to "%s\n" to
get the original output (although the patch doesn't break PostgreSQL
w/o diet libc, AFAICS).
The other modifications in src/timezone/data/europe are a quick fix
because I got the error message "line too long" when trying to do a make
install.
Regards,
Andreas Krennmair