Re: JBoss w/int8 primary keys in postgres ...

From: Barry Lind <blind(at)xythos(dot)com>
To: Rod Taylor <rbt(at)rbt(dot)ca>
Cc: Paul Thomas <paul(at)tmsl(dot)demon(dot)co(dot)uk>, James Robinson <jlrobins(at)socialserve(dot)com>, "pgsql-jdbc (at) postgresql (dot) org" <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: JBoss w/int8 primary keys in postgres ...
Date: 2003-09-09 17:39:24
Message-ID: 3F5E104C.30604@xythos.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Rod,

That was tried once and needed to be pulled out. That change ended up
breaking some code since there are some circumstances where '5' is not
the same as 5 in the parser. I don't remember the details but they
should be in the maillist archives (or the cvs commit message for the
revert on the change).

thanks,
--Barry

PS. Because of having tried and failed to fix this in the driver
before, I am gun shy on trying a fix again at the driver level. The
server is the proper place for this to be fixed. And I think it is in
7.4, but haven't verified that myself.

Rod Taylor wrote:
>>With the proposed modifications to the JDBC driver enabled
>>
>>PreparedStatement pstmt = con.prepareStatement("select name from test
>>where id = ?");
>>pstmt.setLong(1, 42);
>>pstmt.executeQuery();
>>
>>would actually produce:
>>
>>select name from test where id = 42::int8
>
>
> Silly question, but why don't you simply ensure any ?'s are quoted?
>
> select name from test where id = '42'
>
> This allows PostgreSQL to choose the best type for the job -- in this
> case it will try to match that of id. It will work that way on all
> older and newer versions of PostgreSQL.

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message floyds 2003-09-09 17:45:24 contrib/ltree
Previous Message João Ribeiro 2003-09-09 15:46:39 Re: JBoss w/int8 primary keys in postgres ...