]> granicus.if.org Git - postgresql/commit
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)
commit70b9b9b788ceb8d16479fb3e6c5a4a5784a45766
tree38f09e2adecd5159ac0a0b36524844b8c9f2abd8
parentae0b90f223b5cddce80353793340e77c58e215c1
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]