Re: 8.0.0beta4: "copy" and "client_encoding" - Mailing list pgsql-jdbc

From Ulrich Meis
Subject Re: 8.0.0beta4: "copy" and "client_encoding"
Date
Msg-id 200411051539.37753.kenobi@halifax.rwth-aachen.de
Whole thread Raw
In response to Re: 8.0.0beta4: "copy" and "client_encoding"  (Oliver Jowett <oliver@opencloud.com>)
List pgsql-jdbc
On Thursday 04 November 2004 11:17, Oliver Jowett wrote:
>[...]
> I suppose that in the absence of backend support for this, we could add
> some URL parameter that allows client_encoding to be changed, with
> suitably dangerous warnings around using it. Then you can temporarily
> flip client_encoding to LATIN1 for the duration of the COPY, and revert
> it to UNICODE afterwards.

How about relaxing so that things like this are alright:

st.executeUpdate('SET CLIENT_ENCODING TO 'whatever'; COPY/...; SET
CLIENT_ENCODING TO 'UNICODE');

Or - I'm surprised to see that this doesn't work - calling a function that
does the trick:

create or replace function copy_enc(varchar,varchar) RETURNS void AS ' set
client_encoding TO ''LATIN1'';set client_encoding TO ''UNICODE'';' LANGUAGE
SQL;


Uli


pgsql-jdbc by date:

Previous
From: Holger Klawitter
Date:
Subject: Name Lookup Weirdness
Next
From: Markus Schaber
Date:
Subject: Re: 8.0.0beta4: "copy" and "client_encoding"