Re: 8.0.0beta4: "copy" and "client_encoding"

From: Ulrich Meis <kenobi(at)halifax(dot)rwth-aachen(dot)de>
To: Oliver Jowett <oliver(at)opencloud(dot)com>
Cc: mbch67(at)yahoo(dot)com, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: 8.0.0beta4: "copy" and "client_encoding"
Date: 2004-11-05 14:39:37
Message-ID: 200411051539.37753.kenobi@halifax.rwth-aachen.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Markus Schaber 2004-11-05 15:03:24 Re: 8.0.0beta4: "copy" and "client_encoding"
Previous Message Holger Klawitter 2004-11-05 13:42:32 Name Lookup Weirdness