Package: bacula-director-pgsql
Version: 1.36.2-2sarge1
Severity: normal

When it creates the postgresql database, the postinst script omits to
specify a character encoding. Therefore, the system wide setting is used,
which is unicode on my box.

Because of this, when a backup job encounters a filename containing a
character which is illegal in unicode (and this is frequent with latin-1 or
windows filenames), it fails with an SQL error complaining about unicode
infringment.

The solution for me was to create the database with encoding SQL_ASCII, which
accepts every possible character. It would have probably worked as well with
LATIN1 or any other single-byte encoding.

Therefore, I think that the postinst script should be modified, in the
following way:

--- /tmp/bacula-director-pgsql.postinst 2005-06-12 16:42:07.177238406 +0200
+++ bacula-director-pgsql.postinst      2005-06-11 19:24:56.000000000 +0200
@@ -178,7 +178,7 @@
                DB_EXIST=$PGCMD "$PGSQL -l" 2>/dev/null | grep $CATALOG || true
                if [ -z "$DB_EXIST" ]; then
                        if ! $PGCMD "$PGSQL -d template1 \
-                               -c \"CREATE DATABASE $CATALOG;\"" >/dev/null 
2>&1; then
+                               -c \"CREATE DATABASE $CATALOG WITH ENCODING = 
'SQL_ASCII';\"" >/dev/null  2>&1; then
                                echo -e "\nERROR: Database creation failed!";
                                restore_pgpass
                                # Unset parameters since they didn't work, 
re-ask next time


Thanks,

S.V.


-- System Information:
Debian Release: 3.1
Architecture: i386 (i686)
Kernel: Linux 2.6.8-2-686
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)

Versions of packages bacula-director-pgsql depends on:
ii  bacula-common             1.36.2-2sarge1 Network backup, recovery and verif
ii  bacula-director-common    1.36.2-2sarge1 Network backup, recovery and verif
ii  debconf                   1.4.30.13      Debian configuration management sy
ii  postgresql-client         7.4.7-6sarge1  front-end programs for PostgreSQL

-- debconf information:
* bacula-director-pgsql/create_tables: false
* bacula-director-pgsql/db_host: localhost
* bacula-director-pgsql/pgsql_root_username: mot
  bacula-director-pgsql/db_user: bacula
* bacula-director-pgsql/remove_catalog_on_purge: false
* bacula-director-pgsql/drop_db: false


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to