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

From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: Ted Wen <tedwen(at)nesc(dot)ac(dot)uk>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #3806: PreparedStatement.setString(String) throws exception
Date: 2007-12-07 11:58:25
Message-ID: 1197028705.4255.561.camel@ebony.site
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, 2007-12-06 at 23:21 +0000, Ted Wen wrote:

> 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

Try sql = "select * from uuidtab where id=?::uuid";

--
Simon Riggs
2ndQuadrant http://www.2ndQuadrant.com

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Daniel Migowski 2007-12-07 14:39:22 BUG #3808: Connections stays open in state CLOSE_WAIT
Previous Message Kris Jurka 2007-12-07 02:40:59 Re: BUG #3801: max_fsm_pages postgresql.conf default != guc.c default