From: | Martin Pitt <martin(at)piware(dot)de> |
---|---|
To: | pgsql-bugs(at)postgresql(dot)org |
Subject: | Re: Recommended approach for upgrading DBs with nonmatching encodings |
Date: | 2008-03-30 20:58:47 |
Message-ID: | 20080330205847.GP6486@piware.de |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
Tom Lane [2008-03-30 16:43 -0400]:
> Martin Pitt <martin(at)piware(dot)de> writes:
> > One problem with this is that while pg_dump -E UTF8 works (with SQL
> > output), -E does not seem to have any effect when using -Fc.
>
> Huh? Please provide a test case.
Ah, I got it. This fails:
pg_dump -Fc -E UTF8 -p 5432 latin1test | pg_restore -p 5433 -d template1 -C
(5432 is 8.1, 5433 is 8.3, both with locale ru_RU.UTF-8;
createdb -E latin1 latin1test)
But if I create the DB beforehand (with correct encoding) and then
dump/restore without using -C, it works fine:
createdb -p 5433 latin1test
pg_dump -Fc -p 5432 latin1test | pg_restore -p 5433 -d latin1test
In that case I do not even need to specify -E. Seems that
pg_dump/pg_restore are clever enough to detect encodings and necessary
conversions.
So this seems to be the cleanest approach to me, and it's free of
hacks. pg_restore restores the correct owner of the DB, so calling
createdb as the DB superuser does not harm.
Thanks,
Martin
--
Martin Pitt | http://www.piware.de
Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2008-03-30 21:15:19 | Re: Recommended approach for upgrading DBs with nonmatching encodings |
Previous Message | Tom Lane | 2008-03-30 20:43:57 | Re: Recommended approach for upgrading DBs with nonmatching encodings |