BUG #3806: PreparedStatement.setString(String) throws exception

From: "Ted Wen" <tedwen(at)nesc(dot)ac(dot)uk>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #3806: PreparedStatement.setString(String) throws exception
Date: 2007-12-06 23:21:43
Message-ID: 200712062321.lB6NLhLv002499@wwwmaster.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


The following bug has been logged online:

Bug reference: 3806
Logged by: Ted Wen
Email address: tedwen(at)nesc(dot)ac(dot)uk
PostgreSQL version: 8.3beta3
Operating system: Windows
Description: PreparedStatement.setString(String) throws exception
Details:

Code fragment:

String sql = "create table uuidtab(id uuid not null,num int,primary key
(id))";
Statement stmt = conn.createStatement();
stmt.executeUpdate(sql);

sql = "insert into uuidtab
values('8555b4c4-5b3d-41ab-9f0f-c71120a583b1',10)";
stmt.executeUpdate(sql);

sql = "select * from uuidtab where id=?";
PreparedStatement ps = conn.prepareStatement(sql);
ps.setString(1, "8555b4c4-5b3d-41ab-9f0f-c71120a583b1");
ResultSet rs = ps.executeQuery();
if (rs.next()) {
System.out.println(rs.getString(1));
}

The last executeQuery() produces the following error message:
org.postgresql.util.PSQLException: ERROR: operator does not exist: uuid =
character varying

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tani.Masaki 2007-12-07 00:05:04 BUG #3807: SQL : select like statement
Previous Message Andrew Sullivan 2007-12-06 21:27:44 Re: BUG #3803: Error while sending request to database