pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jure Koren <jure@hehe.si>
To: pgsql-jdbc@postgresql.org
Subject: Re: dollar quoting
Date: Tue, 3 Oct 2006 21:46:37 +0200
Message-ID: <200610032146.37524.jure@hehe.si> (raw)
In-Reply-To: <200610032138.28215.jure@hehe.si>
References: <200610031754.38595.jure@hehe.si>
	<9032.1159899269@sss.pgh.pa.us>
	<200610032138.28215.jure@hehe.si>

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.

Sorry, i haven't slept for a while.

-- 
Jure Koren, unix developer
Hehe d.o.o.

Attachments:

postgresql-jdbc-dollarquote.diff (text/x-diff, 1.5K) download Only in postgresql-jdbc-8.2dev-503.src-dq: build Only in postgresql-jdbc-8.2dev-503.src-dq: jars 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:40:36.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++; Only in postgresql-jdbc-8.2dev-503.src/org/postgresql/core/v3: QueryExecutorImpl.java.orig Only in postgresql-jdbc-8.2dev-503.src-dq/org/postgresql: Driver.java Only in postgresql-jdbc-8.2dev-503.src-dq/org/postgresql/util: PSQLException.java

view thread (13+ messages)  latest in thread

Message-ID: <200610032146.37524.jure@hehe.si>
Permalink:  ../200610032146.37524.jure@hehe.si/
Also on:    postgresql.org/message-id/200610032146.37524.jure@hehe.si

 ·  · 

reply

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: <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>

* 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