From: Kris Jurka <books@ejurka.com>
To: Altaf Malik <mmalik_altaf@yahoo.com>
Cc: pgsql-jdbc@postgresql.org
Cc: mpaesold@gmx.at
Subject: Re: Unable to prepare a statement when the object names contain more than one $ symbol
Date: Mon, 9 Jul 2007 12:31:41 -0400 (EDT)
Message-ID: <Pine.BSO.4.64.0707091229520.10973@leary.csoft.net> (raw)
In-Reply-To: <540504.87872.qm@web39103.mail.mud.yahoo.com>
References: <540504.87872.qm@web39103.mail.mud.yahoo.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: books@ejurka.com, mmalik_altaf@yahoo.com, mpaesold@gmx.at
Subject: Re: Unable to prepare a statement when the object names contain more than one $ symbol
In-Reply-To: <Pine.BSO.4.64.0707091229520.10973@leary.csoft.net>
References: <540504.87872.qm@web39103.mail.mud.yahoo.com> <Pine.BSO.4.64.0707091229520.10973@leary.csoft.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox