Sets default encoding for PostgreSQL testing

Fixes the issue of some tests failing when inserting unicode characters
in the PostgreSQL test suite. This patch sets the default encoding of
all created databases to UTF8.

Related to blueprint sql-unit-tests-on-real-backend

Change-Id: Ie8629dd655ddb2327cce13c7e2a31cdb011791b5
This commit is contained in:
Joe H. Rahme 2014-10-09 18:36:04 +02:00
parent a3d6ef216f
commit b23fd8c1fa

View File

@ -16,7 +16,7 @@ check_for_cmd pg_config
PGSQL_DATA=`mktemp -d /tmp/CEILO-PGSQL-XXXXX`
trap "clean_exit ${PGSQL_DATA}" EXIT
PGSQL_PATH=`pg_config --bindir`
${PGSQL_PATH}/initdb ${PGSQL_DATA}
${PGSQL_PATH}/initdb -E UTF8 ${PGSQL_DATA}
mkfifo ${PGSQL_DATA}/out
${PGSQL_PATH}/postgres -N 100 -F -k ${PGSQL_DATA} -D ${PGSQL_DATA} -p 9823 &> ${PGSQL_DATA}/out &
# Wait for PostgreSQL to start listening to connections