PostgreSQL8.4.0 initdb時と違う文字コードでcreatedb

PostgreSQL8.4.0 initdb時と違う文字コードでcreatedb

PostgreSQL8.4.0でinitdb時と違う文字コードでcreatedbをしたらエラーが出た。

$ createdb データベース名 -E UNICODE
createdb: database creation failed: ERROR:  new encoding (UTF8) is incompatible with the encoding of the template database (EUC_JP)
HINT:  Use the same encoding as in the template database, or use template0 as template.


ヒントにtemplateと同じ文字コードを使うか、template0をテンプレートとして使えとあるので、
後者に従い。

$ createdb lottery -E UNICODE -T template0