Re: How to add data with ResultSet object?

From: Kris Jurka <books(at)ejurka(dot)com>
To: vasylenko(at)uksatse(dot)org(dot)ua
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: How to add data with ResultSet object?
Date: 2007-11-26 20:56:03
Message-ID: Pine.BSO.4.64.0711261551150.21413@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Mon, 26 Nov 2007, vasylenko(at)uksatse(dot)org(dot)ua wrote:

> I use "SELECT * from ONLY forcehol" to see raws.
>
> --> //here we have exception with the text "No primary key found for table ONLY"
> rs.moveToInsertRow();
>
> How can I beat such exception about unccorect analysing of my query with
> ONLY syntax?

This is a known driver bug. The parser to determine the base table of an
updatable result set is *very* easily confused. Aside from fixing the
driver the only way to fix this would be to use a view to hide the ONLY
from the driver. CREATE VIEW myonlyview AS SELECT * FROM ONLY forcehol
and then writing appropriate insert rules on it so that you can have the
driver select from and insert into the view.

Kris Jurka

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Marek Lewczuk 2007-11-27 09:02:07 Re: AbstractJdbc2Array - another patch
Previous Message Heikki Linnakangas 2007-11-26 20:39:22 Re: Queries with 'AND' clauses not returning results