Change initdb and CREATE DATABASE to actively reject attempts to create
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 28 Sep 2007 22:25:49 +0000 (22:25 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 28 Sep 2007 22:25:49 +0000 (22:25 +0000)
commitdc0796cc87e1e55363b4e5ee375b448d79e0c7dd
treedfa2dbf5619ad0bbd7e8e2ad77894a557fc6ee07
parentc98465b914e3d841f85a0865711387340f2959a6
Change initdb and CREATE DATABASE to actively reject attempts to create
databases with encodings that are incompatible with the server's LC_CTYPE
locale, when we can determine that (which we can on most modern platforms,
I believe).  C/POSIX locale is compatible with all encodings, of course,
so there is still some usefulness to CREATE DATABASE's ENCODING option,
but this will insulate us against all sorts of recurring complaints
caused by mismatched settings.

I moved initdb's existing LC_CTYPE-to-encoding mapping knowledge into
a new src/port/ file so it could be shared by CREATE DATABASE.
doc/src/sgml/charset.sgml
doc/src/sgml/ref/create_database.sgml
src/Makefile.global.in
src/backend/commands/dbcommands.c
src/bin/initdb/initdb.c
src/include/port.h
src/port/Makefile
src/port/chklocale.c [new file with mode: 0644]