From: | Michael Paesold <mpaesold(at)gmx(dot)at> |
---|---|
To: | pgsql-jdbc(at)postgresql(dot)org |
Subject: | Re: dollar quoting |
Date: | 2006-10-03 20:13:48 |
Message-ID: | 4522C47C.4050607@gmx.at |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-jdbc |
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
From | Date | Subject | |
---|---|---|---|
Next Message | Jure Koren | 2006-10-03 20:36:53 | Re: dollar quoting |
Previous Message | Tom Lane | 2006-10-03 19:54:56 | Re: dollar quoting |