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

From: Michael Paesold <mpaesold(at)gmx(dot)at>
To: Kris Jurka <books(at)ejurka(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Altaf Malik <mmalik_altaf(at)yahoo(dot)com>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Unable to prepare a statement when the object names contain more than one $ symbol
Date: 2007-10-16 15:51:13
Message-ID: 4714DDF1.9020403@gmx.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hi Kris,

sorry for not coming back to this earlier. Yeah, this is no real solution.
I thought about checking the character directly before the dollar quote.
But I have not had the time to look at the grammer if that is enough to fix
all error cases... I will do so tomorrow.

Best Regards
Michael Paesold

Kris Jurka schrieb:
>
>
> On Tue, 10 Jul 2007, Michael Paesold wrote:
>
>> Tom Lane schrieb:
>>> Kris Jurka <books(at)ejurka(dot)com> writes:
>>>> On Mon, 9 Jul 2007, Altaf Malik wrote:
>>>>> PreparedStatement pstmt = con.prepareStatement("insert into a$b$c
>>>>> values( ? , ?)");
>>>
>>>> This is a bug in dollar quote parsing. It assumes that any
>>>> potential dollar quote start will have an end tag.
>>>
>>> If it thinks that's a dollar quote start, it's wrong already... that's
>>> a perfectly valid table name. (Although personally I'd suggest that the
>>> OP avoid dollar signs in identifiers, since they're none too portable.)
>>
>> I guess I missed that case when implementing dollar quoting in the
>> driver. I will have a look at it shortly.
>>
>
> Did you ever get a chance to look at this? The attached patch fixes the
> original complaint by ensuring that the ending tag exists, but as Tom
> pointed out that's still not good enough as the second attached test
> case demonstrates.
>
> Kris Jurka
>

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dominik Heller 2007-10-17 13:56:58 Getting started with jdbc3 and eclipse
Previous Message Tore Halset 2007-10-16 08:29:19 Re: text metadata