Bug in ResultSet.deleteRow() implementation - Mailing list pgsql-jdbc

From Boris Folgmann
Subject Bug in ResultSet.deleteRow() implementation
Date
Msg-id i68nn2$1ch$1@dough.gmane.org
Whole thread Raw
List pgsql-jdbc
Hi,

I couldn't find some information about a bug tracker on
jdbc.postgresql.org, so here's my bug report:

I do a
    SELECT pay_key FROM invoices;

and then delete some expired invoices using deleteRow() on the ResultSet.
This throws

org.postgresql.util.PSQLException: The column name iid was not found in
this ResultSet.
    at
org.postgresql.jdbc2.AbstractJdbc2ResultSet.findColumn(AbstractJdbc2ResultSet.java:2562)
    at
org.postgresql.jdbc2.AbstractJdbc2ResultSet.isUpdateable(AbstractJdbc2ResultSet.java:1535)
    at
org.postgresql.jdbc2.AbstractJdbc2ResultSet.checkUpdateable(AbstractJdbc2ResultSet.java:2661)
    at
org.postgresql.jdbc2.AbstractJdbc2ResultSet.deleteRow(AbstractJdbc2ResultSet.java:715)

iid is the primary key of invoices. If I change the query to

SELECT pay_key, iid FROM invoices;

deleteRow() works. But I don't need iid in the query because it's not
relevant for determining if the invoice expired. So I found a work-around,
but please fix this, as it is not required by the JDBC spec to include the
primary key in the query.

My system:
postgresql-8.4-702.jdbc4.jar
postgresql-8.1.21-1.el5_5.1 on CentOS 5.5.
java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b04)
Java HotSpot(TM) Server VM (build 14.3-b01, mixed mode)

cu,
    boris

pgsql-jdbc by date:

Previous
From: Fabien Jalabert
Date:
Subject: Re: Send a command to postgres and close the program
Next
From: joiny
Date:
Subject: Re: postgresql 8.4 type mapping problem