From: Jure Koren <jure@hehe.si>
To: pgsql-jdbc@postgresql.org
Subject: Re: dollar quoting
Date: Tue, 3 Oct 2006 21:38:19 +0200
Message-ID: <200610032138.28215.jure@hehe.si> (raw)
In-Reply-To: <9032.1159899269@sss.pgh.pa.us>
References: <200610031754.38595.jure@hehe.si>
<4F543962-492E-4455-AA44-EE0D91017DEC@fastcrypt.com>
<9032.1159899269@sss.pgh.pa.us>
On Tuesday 03 October 2006 20:14, Tom Lane wrote:
> Also, this patch is not being nearly cautious enough about what is a
> valid dollar-quote start sequence. The other patch that was proposed
> looked more reasonable on that score.
Yes.
This is the version that I think addresses most of the concerns posted.
Thank you for your feedback.
--
Jure Koren, unix developer
Hehe d.o.o.
Attachments:postgresql-jdbc-dollarquote.diff (text/x-diff, 1.1K) download
diff -ru postgresql-jdbc-8.2dev-503.src/org/postgresql/core/v3/QueryExecutorImpl.java postgresql-jdbc-8.2dev-503.src-dq/org/postgresql/core/v3/QueryExecutorImpl.java
--- postgresql-jdbc-8.2dev-503.src/org/postgresql/core/v3/QueryExecutorImpl.java 2006-10-03 19:06:00.000000000 +0200+++ postgresql-jdbc-8.2dev-503.src-dq/org/postgresql/core/v3/QueryExecutorImpl.java 2006-10-03 21:34:34.000000000 +0200@@ -99,6 +99,21 @@
}
break;
+ case '$':+ if (inDoubleQuotes || inSingleQuotes)+ break;+ int pos = query.indexOf('$', i+1);+ if (pos < 0)+ break;+ String tag = query.substring(i, pos+1);+ if (!tag.matches("^\\$[\\p{L}_][\\p{L}\\d_]*\\$$"))+ break;+ int nextpos = query.indexOf(tag, pos+1);+ if (nextpos < 0)+ break;+ i = nextpos + tag.length() + 2;+ break;+
case '(':
if (!inSingleQuotes && !inDoubleQuotes)
inParen++;
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: jure@hehe.si
Subject: Re: dollar quoting
In-Reply-To: <200610032138.28215.jure@hehe.si>
References: <200610031754.38595.jure@hehe.si> <4F543962-492E-4455-AA44-EE0D91017DEC@fastcrypt.com> <9032.1159899269@sss.pgh.pa.us> <200610032138.28215.jure@hehe.si>
* 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