Thread: restoring to wrong encoding db

restoring to wrong encoding db

From
Vivek Khera
Date:
I was just copying a database that was in UNICODE encoding into a new
db for some testing.  I hand't realized it was UNICODE and when it hit
some funky chinese data (from some spam that came in...) it errored
out with a string too long for a varchar(255).

The dump was created on PG 7.4.3 with "pg_dump -Fc"

The db was created with "createdb rt3"

The restore was to PG 7.4.5 with "pg_restore --verbose -d rt3 rt3.dump"


Is there some way for the dump to notice that the encoding is wrong in
the db into which it is being restored?  Once I created the rt3 db
with encoding='UNICODE' it worked just fine.  Should there be some
kind of check like that?


--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Vivek Khera, Ph.D.                Khera Communications, Inc.
Internet: khera@kciLink.com       Rockville, MD  +1-301-869-4449 x806
AIM: vivekkhera Y!: vivek_khera   http://www.khera.org/~vivek/