Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id EF3E01B505EF for ; Wed, 14 Mar 2012 11:44:28 -0300 (ADT) Received: from cpanelsmarthost2.zen.co.uk ([82.71.204.226]) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1S7pRB-0001iT-PB for pgsql-jdbc@postgresql.org; Wed, 14 Mar 2012 14:44:27 +0000 Received: from [88.98.24.71] (helo=shcp03.hosting.zen.net.uk) by cpanelsmarthost2.zen.co.uk with esmtp (Exim 4.72) (envelope-from ) id 1S7pQy-00066l-2E for pgsql-jdbc@postgresql.org; Wed, 14 Mar 2012 14:44:12 +0000 Received: from [212.135.39.5] (helo=[62.185.32.161]) by shcp03.hosting.zen.net.uk with esmtpa (Exim 4.69) (envelope-from ) id 1S7pQt-0003x3-A9 for pgsql-jdbc@postgresql.org; Wed, 14 Mar 2012 14:44:07 +0000 Message-ID: <4F60AF2F.3000308@ahastie.net> Date: Wed, 14 Mar 2012 14:46:07 +0000 From: Andrew Hastie User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.27) Gecko/20120216 Lightning/1.0b2 Thunderbird/3.1.19 MIME-Version: 1.0 To: pgsql-jdbc@postgresql.org Subject: Re: MoveToInsertRow on a table without a primary key References: <1911821.1566.1331730216537.JavaMail.geo-discussion-forums@pbjv6> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - shcp03.hosting.zen.net.uk X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - ahastie.net X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201203/29 X-Sequence-Number: 22768 Not sure if this helps but:- 1. Examination of the JBC4 spec makes no mention of a PK being a pre-requisite for an updatable ResultSet. It implies "cursors" or similar are employed. 2. MS SQLServer 2008 and IBM DB2 for Linux/Unix/Windows also have a similar restriction. Anyway, a table with no PK is bad design of your database tables anyway ;-) Andrew On 14/03/12 14:05, Dave Cramer wrote: > Pretty sure a primary key is a pre-requisite for an updatable result set. > > Dave Cramer > > dave.cramer(at)credativ(dot)ca > http://www.credativ.ca > > > > On Wed, Mar 14, 2012 at 9:03 AM, wrote: >> Hello all, >> >> I have a table in a database that does not have a primary key. In the process of migrating data from Oracle to Postgres, I am using ResultSets to populate the Postgres tables. >> >> Basically, all is working well except for tables that do not have a primary key. When I reach the "movetoinsertrow" instruction in my code, the jdbc driver raises an exception about the missing primary key. >> >> The workaround would be to add a temporary primary key to such table, but I want to avoid that. I did the same test with HSQLDB and it works. To me, it seems like a bug. >> >> I googled around for the solution, but found nothing. >> >> Any tips? >> >> -- >> Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) >> To make changes to your subscription: >> http://www.postgresql.org/mailpref/pgsql-jdbc