BUG #2319: psql utf8/latin1 client_encoding bug when using '-c'

From: "Mattias Kregert" <mattias(at)kregert(dot)se>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #2319: psql utf8/latin1 client_encoding bug when using '-c'
Date: 2006-03-15 18:13:39
Message-ID: 200603151813.k2FIDdeO071085@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 2319
Logged by: Mattias Kregert
Email address: mattias(at)kregert(dot)se
PostgreSQL version: 8.1.0
Operating system: Linux 2.4
Description: psql utf8/latin1 client_encoding bug when using '-c'
Details:

Psql '-c' does not work when using client_encoding.

Example:
Server has encoding UTF8, client has encoding latin1

-- This works...
% psql -h server mydb
mydb=# set client_encoding to 'latin1';
mydb=# select * from mytable where text='';

-- ...but this does not.
% psql -h server mydb -c "set client_encoding to 'latin1'; select * from
mytable where text='';"
ERROR: invalid UTF-8 byte sequence detected near byte 0xc5

I tried this too, without success:
% psql --set encoding=latin1 -h server mydb ...

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Joe Sunday 2006-03-15 21:35:57 Re: Large join runs out of memory in 8.1
Previous Message Tom Lane 2006-03-15 18:10:41 Re: Large join runs out of memory in 8.1