Re: Best practices for moving UTF8 databases

From: "Daniel Verite" <daniel(at)manitou-mail(dot)org>
To: "Phoenix Kiula" <phoenix(dot)kiula(at)gmail(dot)com>
Cc: "PG-General Mailing List" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Best practices for moving UTF8 databases
Date: 2009-07-21 07:37:04
Message-ID: eb904c27-e670-4274-8e61-68b71169f787@mm
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Phoenix Kiula wrote:

> I'd love to fix them. But if I do a search for
>
> SELECT * FROM xyz WHERE col like '%0x80%'
>
> it doesn't work. How should I search for these characters?

In 8.2, try: WHERE strpos(col, E'\x80') > 0

Note that this may find valid data as well, because the error you get
is when 0x80 is the first byte of a character in UTF8; when it's at
another position, you don't want to change it.

Best regards,
--
Daniel
PostgreSQL-powered mail user agent and storage:
http://www.manitou-mail.org

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Janning Vygen 2009-07-21 07:42:11 Re: suggestion: log_statement = sample
Previous Message Janning Vygen 2009-07-21 07:31:50 Re: suggestion: log_statement = sample