From: Michael Fuhr <mike@fuhr.org>
To: Chris Hoover <revoohc@gmail.com>
Cc: pgsql-admin@postgresql.org Admin <pgsql-admin@postgresql.org>
Subject: Re: Help with High value unicode characters
Date: Wed, 8 Aug 2007 01:57:37 -0600
Message-ID: <20070808075737.GA46023@winnie.fuhr.org> (raw)
In-Reply-To: <1d219a6f0708071409s1f66c0f1u9ff69bc3cc580bcf@mail.gmail.com>
References: <1d219a6f0708071409s1f66c0f1u9ff69bc3cc580bcf@mail.gmail.com>
On Tue, Aug 07, 2007 at 05:09:35PM -0400, Chris Hoover wrote:
> We need some help, we have some what we believe are high value unicode
> characters (Unicode 0x2).
What do you mean by "high value unicode characters (Unicode 0x2)"?
Characters with code points in a plane other than Plane 0 (BMP,
Basic Multilingual Plane), i.e., with a code point greater than
U+FFFF?
> How can you search and replace for these? We are storing this data
> in a text field, and having the data contain this unicode value is
> violating our xml rules the application uses and causing abends in
> our application.
If I understand what you're asking then you should be able to use
regexp_replace (8.1 and later) to fix the data. Example:
UPDATE tablename
SET columnname = regexp_replace(columnname, E'[\\U00010000-\\U0010FFFF]+', '', 'g')
WHERE columnname ~ E'[\\U00010000-\\U0010FFFF]';
If that doesn't help then please clarify the problem.
--
Michael Fuhr
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-admin@postgresql.org
Cc: mike@fuhr.org, revoohc@gmail.com
Subject: Re: Help with High value unicode characters
In-Reply-To: <20070808075737.GA46023@winnie.fuhr.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox