how to dump and restore unicode databases?

From: Andreas Schuldei <andreas(at)schuldei(dot)org>
To: pgsql-admin(at)postgresql(dot)org
Subject: how to dump and restore unicode databases?
Date: 2002-12-17 22:48:18
Message-ID: 20021217224818.GA10840@lukas
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

i have two machines, one with postgres 7.2.X and one with 7.3.
Both their encodings are set to UNICODE.
on the first i have crated a unicode database, with german,
swedish and english texts, more to come. on that machine i dump
the db with pg_dump -c -s ncg and pg_dump -D -a ncg. on that
machine i can restore the structure and data of the database just
fine.

I also edit the dump to use the coziness of my texteditor to add
larger amounts of text. i can restore those edited dumps just fine.

then i try to restore that database on the postgres 7.3. since i
get errors like
ERROR: Invalid UNICODE character sequence found (0xe4636b)
whenever a german or swedish special char occurs, i insert an
\ecoding LATIN1 before the critical sections.

then i can restore the complete database, with the difference
that the special characters are garbage: ö and similar.

How can i dump unicode databases to asci so that they are
restored as unicode? i would like to edit the dump, as explained
above.

or

How can i restore the database with its special chars in tact?

Browse pgsql-admin by date

  From Date Subject
Next Message Ing. Gabriel Monsalvo 2002-12-17 23:03:33 Slow Executing queries
Previous Message King_Henree@yahoo.com 2002-12-17 20:02:41 How to determine which long running session???