Re: No Primary Keys (pg7.4.2 on SLES9)

From: "Vidas Makauskas" <v(dot)makauskas(at)pzu(dot)lt>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: No Primary Keys (pg7.4.2 on SLES9)
Date: 2006-04-05 05:25:07
Message-ID: 001401c65871$4d37f760$8400010a@pzu.lt
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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(at)ejurka(dot)com]
Sent: Wednesday, April 05, 2006 12:34 AM
To: Vidas Makauskas
Cc: pgsql-jdbc(at)postgresql(dot)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

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Pavan Kumar 2006-04-05 06:05:04 Re: thread hang on execute call
Previous Message Kris Jurka 2006-04-04 22:35:03 Re: Prepared statement leak