From 91ea6dfd74480894a79268a21476c189d0b49c4b Mon Sep 17 00:00:00 2001 From: Eric Bollengier Date: Wed, 15 Jul 2009 14:03:07 +0000 Subject: [PATCH] Force the client_encoding to SQL_ASCII when database is already using this mode. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@9006 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/cats/postgresql.c | 7 ++++++- bacula/technotes | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/bacula/src/cats/postgresql.c b/bacula/src/cats/postgresql.c index 5c7b13d033..969232734b 100644 --- a/bacula/src/cats/postgresql.c +++ b/bacula/src/cats/postgresql.c @@ -148,7 +148,12 @@ static bool check_database_encoding(JCR *jcr, B_DB *mdb) Jmsg(jcr, M_ERROR, 0, "Can't check database encoding %s", mdb->errmsg); } else { ret = bstrcmp(row[0], "SQL_ASCII"); - if (!ret) { + + if (ret) { + /* if we are in SQL_ASCII, we can force the client_encoding to SQL_ASCII too */ + db_sql_query(mdb, "SET client_encoding TO 'SQL_ASCII'", NULL, NULL); + + } else { /* something is wrong with database encoding */ Mmsg(mdb->errmsg, _("Encoding error for database \"%s\". Wanted SQL_ASCII, got %s\n"), mdb->db_name, row[0]); diff --git a/bacula/technotes b/bacula/technotes index d53fcd53cf..c5be178e95 100644 --- a/bacula/technotes +++ b/bacula/technotes @@ -5,11 +5,11 @@ General: 15Jul09 kes Fix Win64 build kes Add more example SD Device configurations. +ebl Force the client_encoding to SQL_ASCII when database is already + using this mode. ebl Fix #1335 about postgresql error message during copy session ebl Cleanup old job records when starting the director (Created/Running -> Failed) -ebl Force the client_encoding to SQL_ASCII when database is already - using this mode. 14Jul09 kes Tweak debug print in accurate kes Apply patch in bug #1315 by McMichaeli that fixes scripts/logwatch -- 2.39.5