On Monday 15 September 2008 19:55:42 Ridvan Lakas ng Bayan S. Baluyos wrote:
> And here's the error when dumping the data to the target DB: > ERROR: invalid byte sequence for encoding "UTF8": 0x80 > HINT: This error can also happen if the byte sequence does not match the > encoding expected by the server, which is controlled by "client_encoding". http://www.postgresql.org/docs/8.2/static/multibyte.html what encodings are actually used on the source and destination DBs? It looks like the destination really is UTF8 because of > ERROR: invalid byte sequence for encoding "UTF8": 0x80 but what's the actual encoding on the source? i.e., in psql, what do \l or \l+ (that's a lowercase L) say? ridvan, was that source database always postgresql? or was it SQL Server at some point? Was some SQL Server data migrated to postgresql by al's team? I expect that the source database isn't really UTF8. Or if it is, perhaps it's an older version, from back when encoding wasn't enforced so strictly? Is the field text, varchar, char(n)? or is it perhaps bytea or a blob (unlikely)? if the source and destination really ARE both UTF8, then what versions are both? if you get desperate and can't find a well-behaved way to get the data dumped and loaded into the destination, in the past I've used php's recode function to transliterate data in the wrong encoding into a database (i've done that with both oracle and postgresql). to use php's recode function, you'd dump the schema, load the schema on the destination, then write a function that reads every row in the source db, pushes it through recode (with the appropriate encoding parameter) and insert it into the destination db. but it's probably not yet really time to get desperate. first show us what encoding was used to create the database. you could also do the pg_dump with -C (--create). that'll output the create database statement with, hopefully, the right encoding. tiger -- Gerald Timothy Quimpo [EMAIL PROTECTED] http://bopolissimus*blogspot*com http://monotrematica*blogspot*com You can only be young once. But you can always be immature. -- Dave Barry _________________________________________________ Kagay-Anon Linux Users' Group (KLUG) Mailing List [email protected] (http://lists.linux.org.ph/mailman/listinfo/klug) Searchable Archives: http://archives.free.net.ph
