This note describes a problem that I recently encountered and worked
around, posted here for ease of Googling to help anyone who hits the
same problem in the future.

I wanted to set up a copy of my Bacula Postgres database on another
machine.  I used the make-catalog-backup script to generate a
bacula.sql file which I then copied to the target machine where I had
created a bacula database.  Trying to load the database using:

    psql <bacula.sql

produced this error message:

    ERROR:  invalid byte sequence for encoding "UNICODE": 0xe6736d
    CONTEXT:  COPY filename, line 119616, column name: "l\uffffsmig"

The Postgres documentation explained that this was due to the strict
type-checking that was added to recent versions of Postgres, and
suggested stripping these invalid Unicode sequences from the database
tables using the iconv utility.  There are two problems with this:
first, it will alter the contents of the database; second, the iconv
utility works by reading the entire file that it's converting into
memory, which doesn't work too well with a 3GB SQL file.

What I ended up doing instead was to drop the database and create it
with a character encoding of SQL_ASCII rather than the apparent
default of UNICODE.  

    $ dropdb bacula
    DROP DATABASE
    $ createdb -E sql_ascii bacula
    CREATE DATABASE

This allowed the database to be reloaded successfully, and seems to
have worked although I'm not sure of what effect this may have on sort
order, or weather that even matters.  I'll send a related note to the
-devel list to discuss this and another Postgres-related issue.

-- John Kodis.


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to