pgsql: Close previously open holes for invalidly encoded data to enter

From: adunstan(at)postgresql(dot)org (Andrew Dunstan)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Close previously open holes for invalidly encoded data to enter
Date: 2007-09-18 17:41:17
Message-ID: 20070918174117.CA5F7753E4C@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Log Message:
-----------
Close previously open holes for invalidly encoded data to enter the
database via builtin functions, as recently discussed on -hackers.

chr() now returns a character in the database encoding. For UTF8 encoded databases
the argument is treated as a Unicode code point. For other multi-byte encodings
the argument must designate a strict ascii character, or an error is raised,
as is also the case if the argument is 0.

ascii() is adjusted so that it remains the inverse of chr().

The two argument form of convert() is gone, and the three argument form now
takes a bytea first argument and returns a bytea. To cover this loss three new
functions are introduced:
. convert_from(bytea, name) returns text - converts the first argument from the
named encoding to the database encoding
. convert_to(text, name) returns bytea - converts the first argument from the
database encoding to the named encoding
. length(bytea, name) returns int - gives the length of the first argument in
characters in the named encoding

Modified Files:
--------------
pgsql/doc/src/sgml:
func.sgml (r1.395 -> r1.396)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/func.sgml?r1=1.395&r2=1.396)
pgsql/src/backend/catalog:
pg_conversion.c (r1.36 -> r1.37)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/catalog/pg_conversion.c?r1=1.36&r2=1.37)
pgsql/src/backend/utils/adt:
oracle_compat.c (r1.70 -> r1.71)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/oracle_compat.c?r1=1.70&r2=1.71)
pgsql/src/backend/utils/mb:
mbutils.c (r1.63 -> r1.64)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/mb/mbutils.c?r1=1.63&r2=1.64)
wchar.c (r1.63 -> r1.64)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/mb/wchar.c?r1=1.63&r2=1.64)
pgsql/src/include/catalog:
catversion.h (r1.424 -> r1.425)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/catversion.h?r1=1.424&r2=1.425)
pg_proc.h (r1.469 -> r1.470)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/catalog/pg_proc.h?r1=1.469&r2=1.470)
pgsql/src/include/mb:
pg_wchar.h (r1.72 -> r1.73)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/mb/pg_wchar.h?r1=1.72&r2=1.73)
pgsql/src/include/utils:
builtins.h (r1.302 -> r1.303)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/utils/builtins.h?r1=1.302&r2=1.303)

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message User Kocka 2007-09-18 18:18:29 jdbccache - jdbccache: LinkedList handling fix
Previous Message User Cunha17 2007-09-18 17:36:03 snapshot - src: Support for ODBC and some identation.

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2007-09-18 18:04:32 Re: invalidly encoded strings
Previous Message Pavan Deolasee 2007-09-18 17:41:12 Re: Open issues for HOT patch