diff -ur postgresql-7.4/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java postgresql-7.4-patched/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java
--- postgresql-7.4/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java	2003-10-28 19:39:09.000000000 -0700
+++ postgresql-7.4-patched/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java	2003-12-08 18:26:02.000000000 -0700
@@ -527,6 +527,7 @@
 			int columnType = result.getMetaData().getColumnType(1);
 			if (columnType != functionReturnType)
 				throw new PSQLException ("postgresql.call.wrongrtntype",
+										 PSQLState.DATA_TYPE_MISMATCH,
 										 new Object[]{
 											 "java.sql.Types=" + columnType, "java.sql.Types=" + functionReturnType });
 			result.close ();
diff -ur postgresql-7.4/src/interfaces/jdbc/org/postgresql/util/PSQLException.java postgresql-7.4-patched/src/interfaces/jdbc/org/postgresql/util/PSQLException.java
--- postgresql-7.4/src/interfaces/jdbc/org/postgresql/util/PSQLException.java	2003-09-08 11:30:22.000000000 -0600
+++ postgresql-7.4-patched/src/interfaces/jdbc/org/postgresql/util/PSQLException.java	2003-11-20 13:30:54.000000000 -0700
@@ -224,6 +224,6 @@
 	
 	public String getSQLState()
 	{
-		return state.getState();
+		return state == null ? "null" : state.getState();
 	}
 }
diff -ur postgresql-7.4/src/interfaces/jdbc/org/postgresql/util/PSQLState.java postgresql-7.4-patched/src/interfaces/jdbc/org/postgresql/util/PSQLState.java
--- postgresql-7.4/src/interfaces/jdbc/org/postgresql/util/PSQLState.java	2003-09-12 22:02:16.000000000 -0600
+++ postgresql-7.4-patched/src/interfaces/jdbc/org/postgresql/util/PSQLState.java	2003-12-02 16:40:05.000000000 -0700
@@ -10,7 +10,7 @@
  
  package org.postgresql.util;
  
- public class PSQLState
+ public class PSQLState implements java.io.Serializable
  {
  	private String state;
 	
