Skip site navigation (1) Skip section navigation (2)

Re: [pgsql-jdbc] dollar-quoted CREATE FUNCTION statement fails

From: Michael Paesold <mpaesold(at)gmx(dot)at>
To: Michael Paesold <mpaesold(at)gmx(dot)at>
Cc: Dave Cramer <pg(at)fastcrypt(dot)com>, Grégory Chazalon <Gregory(dot)Chazalon(at)advestigo(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: [pgsql-jdbc] dollar-quoted CREATE FUNCTION statement fails
Date: 2006-10-01 13:46:53
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc
Michael Paesold wrote:
> Dave Cramer wrote:
>  >> I guess it's just a matter of coding, right? Would the JDBC
>  >> maintainers accept a patch for the 8.2 release of the driver?
>  > Absolutely!
> Ok, I am going to write support for this... [snip]

Here is a first version of the patch. It works well for me so far, so I 
am asking for comments now.

This patch only adds knowledge about dollar-quotes to 
v3.QueryExecutorImpl.parseQuery() for now, but there are other possible
- V2Query: for people connecting to postgres >= 8.0 using
- AbstractJdbc2Statement.modifyJdbcCall() for prepareCall: I would not
   expect someone to use dollar-quoting here, but single-quotes are
   supported, so adding dollar-quoting does not seem completely off

I have tried to make the patch rather non-invasive. I thought about 
improving parseQuery to be more efficient, but without having done any 
profiling, I did not want to considerably change the existing code 
paths. All JUnit tests still pass running against an 8.1 server.


- Remove an unused variable from parseQuery


- Add static methods isDollarQuoteStartChar(char) and

- Add support for dollar-quoting in parseQuery

- New file with JUnit tests for new code

- Add the new JUnit TestCase to the test suite if server >= 8.0 and
   protocolVersion == 3

Best Regards
Michael Paesold

Attachment: p1-remove-unused-var.patch
Description: text/plain (559 bytes)
Attachment: p2-v3protocol-dolquot.patch
Description: text/plain (11.9 KB)

In response to


pgsql-jdbc by date

Next:From: Dave CramerDate: 2006-10-01 14:15:03
Subject: Re: Query ResultSet parsing speedup patch (resend)
Previous:From: Holger SchulzDate: 2006-10-01 10:57:17
Subject: Bug extracting bit value

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group