From: Michael Paesold <mpaesold@gmx.at>
To: pgsql-jdbc@postgresql.org
Subject: Re: dollar quoting
Date: Tue, 03 Oct 2006 22:13:48 +0200
Message-ID: <4522C47C.4050607@gmx.at> (raw)
In-Reply-To: <200610032146.37524.jure@hehe.si>
References: <200610031754.38595.jure@hehe.si>
<9032.1159899269@sss.pgh.pa.us>
<200610032138.28215.jure@hehe.si>
<200610032146.37524.jure@hehe.si>
Jure Koren wrote:
> On Tuesday 03 October 2006 21:38, Jure Koren wrote:
>> This is the version that I think addresses most of the concerns posted.
>
> Except for the empty ($$) tag, which this, hopefully last version, does as
> well.
Some more comments:
- I don't think the regular expression is quite there yet, look at the code
in the other patch -- the "c > 127" part
- Having said that, I don't believe in compiling a regular expression for
each dollar-quoted string and each $ character that is not part of a dollar
quote
- There must be something wrong with this line at the end of a dollar-quote:
i = nextpos + tag.length() + 2;
My other patch has this here:
i += dollarQuoteTag.length() - 1;
"nextpos" in the first case should be the same as "i" in the second case.
Something like ..$$String$$; SELECT ... will break here, I guess. My patch
included JUnit tests to detect such off-by-one-or-more errors. You could
use them.
I am now wondering which version has the better performance... especially I
would like to know if switching between scanning the char[] and the
original query string in this patch has any negative impact. If not, it
could be applied quite easily to the other one. Perhaps you could evaluate
both versions for performance?
Best Regards,
Michael Paesold
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: mpaesold@gmx.at
Subject: Re: dollar quoting
In-Reply-To: <4522C47C.4050607@gmx.at>
References: <200610031754.38595.jure@hehe.si> <9032.1159899269@sss.pgh.pa.us> <200610032138.28215.jure@hehe.si> <200610032146.37524.jure@hehe.si> <4522C47C.4050607@gmx.at>
* 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