From 7854a98d05c2f3f41a82dd4ec162d9474ad94e8d Mon Sep 17 00:00:00 2001 From: romke Date: Sat, 23 Jul 2005 13:30:44 +0000 Subject: [PATCH] - what about NOT using UNICODE as initdb encoding? (hardcoded -E UNICODE) changes supporting sysconfig PG_INITDB_ENCODING to alter initdb encoding. Changed files: postgresql.init -> 1.65 postgresql.sysconfig -> 1.20 --- postgresql.init | 10 +++++++++- postgresql.sysconfig | 5 +++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/postgresql.init b/postgresql.init index 8cabf35..8566255 100644 --- a/postgresql.init +++ b/postgresql.init @@ -18,6 +18,9 @@ cd / # Get network config . /etc/sysconfig/network +# Preconfigure some variables: +PG_INITDB_ENCODING=UNICODE + # Get service config if [ -f /etc/sysconfig/postgresql ]; then . /etc/sysconfig/postgresql @@ -216,7 +219,12 @@ case "$action" in mkdir -p $pgdir chmod 700 $pgdir chown postgres:postgres $pgdir - TMPDIR=/tmp su postgres -s /bin/sh -c "initdb -E UNICODE -D $pgdir" + if [ "x${PG_INITDB_ENCODING}x" != "xx" ]; then + TMPENC="-E ${PG_INITDB_ENCODING}" + else + TMPENC= + fi + TMPDIR=/tmp su postgres -s /bin/sh -c "initdb ${TMPENC} -D $pgdir" fi done echo $(nls "REMEMBER to setup password for user \"postgres\"")'!' diff --git a/postgresql.sysconfig b/postgresql.sysconfig index e837eaa..5f37ecf 100644 --- a/postgresql.sysconfig +++ b/postgresql.sysconfig @@ -6,6 +6,11 @@ # you should change TCP/IP port, at least. # +# if you want change default initdb encoding use (value WITHOUT QUOTES!): +# PG_INITDB_ENCODING=UNICODE +# e.g. if you want use database default encoding use: +# PG_INITDB_ENCODING= + # standard setting PG_DB_CLUSTERS="/var/lib/pgsql" -- 2.44.0