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