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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers