Re: LATIN2->UTF8 conversation with dblink - Mailing list pgsql-novice

From Joe Conway
Subject Re: LATIN2->UTF8 conversation with dblink
Date
Msg-id 4987AC82.8030608@joeconway.com
Whole thread Raw
In response to Re: LATIN2->UTF8 conversation with dblink  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [HACKERS] LATIN2->UTF8 conversation with dblink  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-novice
Tom Lane wrote:
> Ruzsinszky Attila <ruzsinszky.attila@gmail.com> writes:
>> The DB is the same except the character coding. Source is LATIN2 and
>> the target DB is UTF8.
>> We wrote a trigger to copy the data from source to target with dblink.
>> The problem is the
>> different DB character coding! PGSQL complains about wrong byte order.
>
> Hmm.  You can presumably fix this by setting client_encoding in the
> dblink connection to match the encoding in use in the database it's
> called in.  But I wonder why dblink doesn't just do that for you
> automatically.

Mainly because I never thought about it myself before, and this is the
first time I've seen someone complain ;-)

But if you think automatically setting client encoding is appropriate, I
will make the change. Would it be classified as a bug (and therefore
something to backpatch) or a new feature?

Joe

pgsql-novice by date:

Previous
From: Nikhil teltia
Date:
Subject: Function Returning a Set of Composite Value
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] LATIN2->UTF8 conversation with dblink