Re: Advice - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: Advice
Date
Msg-id 412215E8.5040702@opencloud.com
Whole thread Raw
In response to Re: Advice  (Dave Cramer <pg@fastcrypt.com>)
List pgsql-jdbc
Dave Cramer wrote:

> there is a well known issue with serial8. The index will not be used if
> you do select foo where serialvalue=1;
> you need to cast the 1 to int8
> ie select foo where serialvalue=1::int8 ( this is fixed in 8.0 )

This should also be fixed if you use the latest development driver,
connect to a 7.4 or later server, and use setLong() (or setObject with
Types.BIGINT) to set the parameter value. The V3 protocol Parse/Bind
messages that newer drivers generate will specify int8 for the parameter
type in this case, which is roughly equivalent to explicitly casting the
parameter to int8.

I haven't tested this, though -- it's theoretical :)

-O

pgsql-jdbc by date:

Previous
From: Dave Cramer
Date:
Subject: Re: Advice
Next
From: Dave Cramer
Date:
Subject: Re: Advice