Re: BUG #4890: Allow insert character has no equivalent in "LATIN2"

From: Robert Świętochowski <robert(dot)swietochowski(at)akpa(dot)pl>
To: "Craig Ringer" <craig(at)postnewspapers(dot)com(dot)au>
Cc: pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: BUG #4890: Allow insert character has no equivalent in "LATIN2"
Date: 2009-07-14 07:52:49
Message-ID: op.uw1r6birp9grny@k151-pc-sa.akpa.pl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Dnia 13-07-2009 o 19:58:50 Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
napisał(a):

> (Please reply to the list, not just to me)
>

I'm sorry.

> I'd still like to know how you're setting your client encoding. You
> can't just run "SET client_encoding='win1250'" - you must tell the
> client program, or the terminal it runs in, to use the appropriate
> encoding as well. Otherwise when you paste the per-mille character
> you'll see the right glyph, but the CLIENT will interpret that as the
> character in the encoding you specified.
>
> So, if you're using a utf-8 terminal, that means that the terminal will
> send 0xe2 0x80 0xb0 for per-mille, which when interpreted as win1250
> becomes ‰ , so that's what the server thinks you sent it.
>
> In that case, though, you'd find that the euro symbol, which isn't
> defined in latin-2, will cause an error:
>
> ERROR: character 0xe282ac of encoding "UTF8" has no equivalent in
> "LATIN2"
>

I didn't use terminal, I used pgAdmin III for first test
and you're right, this was not good idea, but somehow
validation for invalid characters work properly.
For later tests I used python-psycopg2 script.

--
Robert Świętochowski

__
AKPA Polska Press Sp. z o.o., 02-221 Warszawa, ul. Zbąszyńska 5, NIP 521-10-00-270
Sąd Rejonowy dla m.st. Warszawy, XIII Wydział Gospodarczy KRS 0000023945;
Kapitał zakładowy 516.900,00 PLN (w całości opłacony).

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Frank Spies 2009-07-14 09:20:31 Re: BUG #4918: Weird input syntax for intervals
Previous Message Frank van Vugt 2009-07-14 07:42:46 Re: SPI_ERROR_CONNECT within pl/pgsql, PG 8.4