On Fri, 2006-10-27 at 14:42 -0700, Jeff Davis wrote:
> You can insert invalid UTF8 bytes sequences into a TEXT type on an 8.1
> installation by doing something like:
> 

I created a patch that appears to fix the problem, and does not appear
to break anything else.

Is this acceptable?

Regards,
        Jeff Davis
--- pgsql.orig/src/backend/parser/parse_type.c	Tue Oct 31 10:30:22 2006
+++ pgsql/src/backend/parser/parse_type.c	Tue Oct 31 11:05:11 2006
@@ -23,6 +23,7 @@
 #include "utils/builtins.h"
 #include "utils/lsyscache.h"
 #include "utils/syscache.h"
+#include "mb/pg_wchar.h"
 
 
 /*
@@ -367,6 +368,7 @@
 	Oid			typinput;
 	Oid			typioparam;
 
+	pg_verifymbstr(string,strlen(string),0);
 	typinput = ((Form_pg_type) GETSTRUCT(tp))->typinput;
 	typioparam = getTypeIOParam(tp);
 	return OidInputFunctionCall(typinput, string,
---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               http://www.postgresql.org/docs/faq

Reply via email to