Running the JDBC driver's regression test suite for the first time in a while I got a lot of failures that I would have to guess are related to plan invalidation work. Attached is a self contained test case and the JDBC driver's log of what protocol messages it is sending.

The end result is:

ERROR: cache lookup failed for type 2139062143

Kris Jurka
17:49:35.382 (1) PostgreSQL 8.3devel JDBC3g with SSL (build 600)
17:49:35.390 (1) Trying to establish a protocol version 3 connection to 
localhost:5830
17:49:35.413 (1)  FE=> StartupPacket(user=jurka, database=jurka, 
client_encoding=UNICODE, DateStyle=ISO)
17:49:35.417 (1)  <=BE AuthenticationOk
17:49:35.432 (1)  <=BE ParameterStatus(client_encoding = UNICODE)
17:49:35.432 (1)  <=BE ParameterStatus(DateStyle = ISO, MDY)
17:49:35.433 (1)  <=BE ParameterStatus(integer_datetimes = off)
17:49:35.433 (1)  <=BE ParameterStatus(is_superuser = on)
17:49:35.433 (1)  <=BE ParameterStatus(server_encoding = LATIN1)
17:49:35.433 (1)  <=BE ParameterStatus(server_version = 8.3devel)
17:49:35.433 (1)  <=BE ParameterStatus(session_authorization = jurka)
17:49:35.433 (1)  <=BE ParameterStatus(standard_conforming_strings = off)
17:49:35.433 (1)  <=BE ParameterStatus(TimeZone = Navajo)
17:49:35.433 (1)  <=BE BackendKeyData(pid=27730,ckey=216493403)
17:49:35.434 (1)  <=BE ReadyForQuery(I)
17:49:35.434 (1)     compatible = 8.3
17:49:35.434 (1)     loglevel = 2
17:49:35.434 (1)     prepare threshold = 5
getConnection returning driver[className=org.postgresql.Driver,[EMAIL PROTECTED]
17:49:35.459 (1) simple execute, [EMAIL PROTECTED], maxRows=0, fetchSize=0, 
flags=17
17:49:35.460 (1)  FE=> Parse(stmt=null,query="CREATE TEMP TABLE nulltest (a 
int)",oids={})
17:49:35.460 (1)  FE=> Bind(stmt=null,portal=null)
17:49:35.460 (1)  FE=> Describe(portal=null)
17:49:35.461 (1)  FE=> Execute(portal=null,limit=0)
17:49:35.461 (1)  FE=> Sync
17:49:35.482 (1)  <=BE ParseComplete [null]
17:49:35.482 (1)  <=BE BindComplete [null]
17:49:35.482 (1)  <=BE NoData
17:49:35.482 (1)  <=BE CommandStatus(CREATE TABLE)
17:49:35.483 (1)  <=BE ReadyForQuery(I)
17:49:35.484 (1) simple execute, [EMAIL PROTECTED], maxRows=0, fetchSize=0, 
flags=21
17:49:35.484 (1)  FE=> Parse(stmt=null,query="INSERT INTO nulltest (a) VALUES 
($1)",oids={23})
17:49:35.485 (1)  FE=> Bind(stmt=null,portal=null,$1=<NULL>)
17:49:35.485 (1)  FE=> Describe(portal=null)
17:49:35.485 (1)  FE=> Execute(portal=null,limit=1)
17:49:35.485 (1)  FE=> Sync
17:49:35.487 (1)  <=BE ParseComplete [null]
17:49:35.489 (1)  <=BE ErrorMessage(ERROR: cache lookup failed for type 
2139062143)
org.postgresql.util.PSQLException: ERROR: cache lookup failed for type 
2139062143
        at 
org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:1548)
        at 
org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1316)
        at 
org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:191)
        at 
org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:452)
        at 
org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:351)
        at 
org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2Statement.java:305)
        at TestSetNull.main(TestSetNull.java:16)
SQLException: SQLState(XX000)
17:49:35.491 (1)  <=BE ReadyForQuery(I)
import java.sql.*;

public class TestSetNull {

        public static void main(String args[]) throws Exception {
                Class.forName("org.postgresql.Driver");

                Connection conn = 
DriverManager.getConnection("jdbc:postgresql://localhost:5830/jurka?loglevel=2","jurka","");

                Statement stmt = conn.createStatement();
                stmt.execute("CREATE TEMP TABLE nulltest (a int)");
                stmt.close();

                PreparedStatement ps = conn.prepareStatement("INSERT INTO 
nulltest (a) VALUES (?)");
                ps.setNull(1, Types.INTEGER);
                ps.executeUpdate();

                conn.close();
        }
}
---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Reply via email to