Re: Bad Data back Door - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Bad Data back Door
Date
Msg-id 50700BC3.90004@vmware.com
Whole thread Raw
In response to Re: Bad Data back Door  (John R Pierce <pierce@hogranch.com>)
Responses Re: Bad Data back Door  (John R Pierce <pierce@hogranch.com>)
List pgsql-hackers
On 06.10.2012 05:14, John R Pierce wrote:
> I'd like to see some encoding validation and substitution functions in
> postgres. for instance, one that can take any supported encoding and
> convert it to the database encoding and generate an error on any invalid
> character. this translation could be identity (eg, UTF8->UTF8) whereupon
> it would just validate.

See pg_any_to_server() in mbutils.c. At the SQL level, there's the 
convert(bytea, name, name) function.

> a 2nd function would do the same, but replace
> errors with the substitution character in the target charset and not error.

Hmm, I don't think we have that.

- Heikki



pgsql-hackers by date:

Previous
From: Marc Balmer
Date:
Subject: Add FET to Default and Europe.txt
Next
From: Bruce Momjian
Date:
Subject: Re: Add FET to Default and Europe.txt