Re: Update ResultSet

From: tivvpgsqljdbc(at)gtech-ua(dot)com
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Update ResultSet
Date: 2007-10-10 13:39:47
Message-ID: 470CD623.4050109@gtech-ua.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi.

I'd create an updatable server-side view and issue select against it.
Not sure if primary key information will be propagated, but you can try.

Christian Rengstl wrote:
> And I suppose there is no reasonable workaround, is there?
>
>

>
>>>> On Wed, Oct 10, 2007 at 2:53 PM, in message
>>>>
> <470CCB67(dot)80106(at)enterprisedb(dot)com>,
> "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com> wrote:
>
>> Only simple result sets coming from a single table, with no joins,
>>
> are
>
>> updateable. Granted, the error message is misleading. The driver has
>>
> to
>
>> parse the query, to extract the name of the table to update or throw
>>
> an
>
>> error if there's more than one table involved. In this case, it
>>
> doesn't
>
>> understand the INNER JOIN, and therefore you get the misleading
>>
> error
>
>> message instead of this: "ResultSet is not updateable. The query
>>
> that
>
>> generated this result set must select only one table, and must
>>
> select
>
>> all primary keys from that table. See the JDBC 2.1 API
>>
> Specification,
>
>> section 5.6 for more details."
>>

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Marek Lewczuk 2007-10-11 08:59:19 AbstractJdbc2Array - another patch
Previous Message Christian Rengstl 2007-10-10 13:13:45 Re: Update ResultSet