X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id B035211F61C0 for ; Wed, 5 Apr 2006 02:25:43 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 00522-06 for ; Wed, 5 Apr 2006 02:25:42 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sol.pzu.lt (sol.pzu.lt [213.197.173.1]) by postgresql.org (Postfix) with ESMTP id B476911F61D8 for ; Wed, 5 Apr 2006 02:25:40 -0300 (ADT) Received: (qmail 4703 invoked by uid 509); 5 Apr 2006 08:25:38 +0300 Received: from 10.1.0.132 by mail.pzu.lt (envelope-from , uid 508) with qmail-scanner-1.24-st-qms (clamdscan: 0.81rc1/688. spamassassin: 2.55. perlscan: 1.24-st-qms. Clear:RC:1(10.1.0.132):. Processed in 1.700055 secs); 05 Apr 2006 05:25:38 -0000 X-Antivirus-MYDOMAIN-Mail-From: v.makauskas@pzu.lt via mail.pzu.lt X-Antivirus-MYDOMAIN: 1.24-st-qms (Clear:RC:1(10.1.0.132):. Processed in 1.700055 secs Process 4690) Received: from makauskasv.pzu.lt (HELO makauskasv) (10.1.0.132) by sol.pzu.lt with SMTP; 5 Apr 2006 08:25:36 +0300 From: "Vidas Makauskas" To: Subject: Re: No Primary Keys (pg7.4.2 on SLES9) Date: Wed, 5 Apr 2006 08:25:07 +0300 Organization: PZU LIETUVA Message-ID: <001401c65871$4d37f760$8400010a@pzu.lt> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Thread-Index: AcZYL4caAon/F9A+TBeYeUEGbW3CCQAQL3RA X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.12 required=5 tests=[AWL=0.120, UPPERCASE_25_50=0] X-Spam-Score: 0.12 X-Spam-Level: X-Archive-Number: 200604/43 X-Sequence-Number: 14977 Thanks for fast response, I found one more way: 1. create table WITH OIDS (by default) st.executeUpdate("CREATE TABLE public.testas (loid integer, othe integer PRIMARY KEY)"); 2. executeQuery("SELECT p.oid, p.* ... "SELECT p.*" - not suitable, must be "SELECT p.oid, p.*" Best regards -----Original Message----- From: Kris Jurka [mailto:books@ejurka.com] Sent: Wednesday, April 05, 2006 12:34 AM To: Vidas Makauskas Cc: pgsql-jdbc@postgresql.org Subject: Re: [JDBC] No Primary Keys (pg7.4.2 on SLES9) On Mon, 3 Apr 2006, Vidas Makauskas wrote: > I get error NO PRIMARY KEY from prs.moveToInsertRow(); > > Postgres 7.4.2 on with /usr/share/pgsql/pg73b1jdbc3.jar > > Statement st = pg.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, > ResultSet.CONCUR_UPDATABLE); > st.executeUpdate("CREATE TABLE public.testas (loid integer PRIMARY KEY) > WITHOUT OIDS"); > ResultSet prs = st.executeQuery("SELECT p.* FROM public.testas p"); > prs.moveToInsertRow(); Older JDBC drivers do not support schema qualified table names for updatable result sets. Try a newer version: http://jdbc.postgresql.org/download.html Kris Jurka