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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Mattias Kregert" <mattias(at)kregert(dot)se>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2319: psql utf8/latin1 client_encoding bug when using '-c'
Date: 2006-03-16 00:56:28
Message-ID: 10905.1142470588@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Mattias Kregert" <mattias(at)kregert(dot)se> writes:
> -- ...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

There is no hope of that ever working, since the string will be read (and
converted to the server's encoding if relevant) before the SET is
executed. Better find another way to do what you want.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2006-03-16 00:59:49 Re: BUG #2317: Wrong sorting order for (VW)
Previous Message Tom Lane 2006-03-16 00:54:05 Re: BUG #2315: Crash engine after modify "active" function