Jim Finnerty wrote: > SET client_encoding = WIN1252; > [...] > postgres=# SELECT * FROM locations WHERE location LIKE 'Franche-Comt__'; -- > the wildcard is applied byte by byte instead of character by character, so > the 2-byte accented character is matched only by 2 '_'s > location > ---------------- > Franche-Comté > (1 row)
The most plausible explanation is that the client-side text is encoded in UTF-8, rather than WIN1252 as declared. If you added length('Franche-Comté') to the above query, I suspect it would tell that the string is one character longer than expected, and octet_length('Franche-Comté') would be two-byte longer than expected. Also dumping the contents of the "location" column with convert_to() would show that the accents have been wrongly translated, if the explanation of the encoding snafu is correct. Best regards, -- Daniel Vérité PostgreSQL-powered mailer: https://www.manitou-mail.org Twitter: @DanielVerite