Re: Using indices with long unique IDs.

From: Greg Stark <gsstark(at)mit(dot)edu>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Using indices with long unique IDs.
Date: 2004-01-09 20:38:38
Message-ID: 87wu806enl.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Sergey Olefir" <so3lv(at)yahoo(dot)com> writes:

> Unfortunately neither of them seem to be portable (for example, the one with
> single quotes fails if I create PreparedStatement in Java:
> con.prepareStatement("SELECT * FROM table WHERE id='?'"); apparently Java
> doesn't parse question mark inside quotes).

That's wrong. You should not quote the ? in the query.

If the driver is textually substituting the argument (as was necessary in 7.3
and prior) then it probably ought to quote it. If it's not there should be an
option to tell it to quote even integer arguments.

If it's any consolation 7.5 will use the index even if you put a plain integer
in the query. If production is a long way off you could consider developing
against a CVS build today and plan to use 7.5 for production when it comes
out.

--
greg

In response to

Browse pgsql-general by date

  From Date Subject
Next Message scott.marlowe 2004-01-09 21:03:40 Re: no space left on device
Previous Message Aurangzeb M. Agha 2004-01-09 20:31:11 no space left on device