On Thu, 18 May 2006, Alexandre de Arruda Paes wrote:
> I have a problem and I want know if this can be solved in the jdbc driver.
> Our company develop softwares using a CASE Tool caled Genexus. The
> SQL sintaxe are not changeable and they have a big problem: the querys
> aren't casted.
> SELECT field from table where field=10
> If the field are int2 or int8, PostgreSQL don't use indexes (its
> converts the value 10 to int4).
This should work fine in 8.0 and up when cross type index access was
added. If you're not using 8.0+ consider an upgrade. If you are using
8.0+ please provide more details about your problem.
> Can I put an implicit (automatic) cast (' ' - apostrofes) in the SQL
> sintaxes passed throught JDBC ???
You can write:
SELECT field FROM table WHERE field = ?::int8
SELECT field FROM table WHERE field = CAST(? AS int8);
In response to
pgsql-jdbc by date
|Next:||From: Jagadish Prasath Ramu||Date: 2006-05-19 10:09:24|
|Subject: BUG #2444: XA Connections given by posgres driver has auto-commit value false by default|
|Previous:||From: Alexandre de Arruda Paes||Date: 2006-05-18 22:11:35|
|Subject: Automatic cast|