This should fix the problem.
--- src/pl/plpgsql/src/pl_comp.c.orig	Wed Oct  4 03:30:13 2006
+++ src/pl/plpgsql/src/pl_comp.c	Wed Jan 31 19:47:56 2007
@@ -1471,6 +1471,7 @@
 				var->value = 0;
 				var->isnull = true;
 				var->freeval = false;
+				var->notnull = dtype->typnotnull;
 
 				plpgsql_adddatum((PLpgSQL_datum *) var);
 				if (add2namespace)
@@ -1768,6 +1769,7 @@
 	typ->typioparam = getTypeIOParam(typeTup);
 	fmgr_info(typeStruct->typinput, &(typ->typinput));
 	typ->atttypmod = typmod;
+	typ->typnotnull = typeStruct->typnotnull;
 
 	return typ;
 }
--- src/pl/plpgsql/src/plpgsql.h.orig	Wed Oct  4 03:30:14 2006
+++ src/pl/plpgsql/src/plpgsql.h	Wed Jan 31 19:39:55 2007
@@ -142,6 +142,7 @@
 	Oid			typioparam;
 	FmgrInfo	typinput;		/* lookup info for typinput function */
 	int32		atttypmod;		/* typmod (taken from someplace else) */
+	bool		typnotnull;		/* for domains */
 } PLpgSQL_type;
 
 
---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Reply via email to