Re: Unable to prepare a statement when the object names contain more than one $ symbol

Поиск
Список
Период
Сортировка
От Kris Jurka
Тема Re: Unable to prepare a statement when the object names contain more than one $ symbol
Дата
Msg-id Pine.BSO.4.64.0707091229520.10973@leary.csoft.net
обсуждение исходный текст
Ответ на Unable to prepare a statement when the object names contain more than one $ symbol  (Altaf Malik <mmalik_altaf@yahoo.com>)
Ответы Re: Unable to prepare a statement when the object names contain more than one $ symbol
Список pgsql-jdbc

On Mon, 9 Jul 2007, Altaf Malik wrote:

> I have a table with two columns of type varchar and the table name
> contains two dollars. I am unable to prepare a statement for this table.
> Here is the code:
>
> PreparedStatement pstmt = con.prepareStatement("insert into a$b$c
> values( ? , ?)");

> Exception in thread "main" org.postgresql.util.PSQLException: The column index is out of range: 1, number of columns:
0.

This is a bug in dollar quote parsing.  It assumes that any potential
dollar quote start will have an end tag.  When it doesn't find the end it
reports the end of the query, so the driver ends up skipping over the "?"
parameters.

Kris Jurka

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: student23
Дата:
Сообщение: stddev_pop, stddev_samp strange behaviour
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Unable to prepare a statement when the object names contain more than one $ symbol