pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: Oliver Jowett <oliver@opencloud.com>
Cc: Tim Penhey <tim@penhey.net>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Problem with dollar-quoted CREATE OR REPLACE FUNCTION
Date: Tue, 14 Sep 2004 21:38:36 -0500 (EST)
Message-ID: <Pine.BSO.4.56.0409142132490.9485@leary.csoft.net> (raw)
In-Reply-To: <41477610.8070202@opencloud.com>
References: <41470089.8010207@penhey.net>
	<Pine.BSO.4.56.0409141340180.27@leary.csoft.net>
	<41477610.8070202@opencloud.com>



On Wed, 15 Sep 2004, Oliver Jowett wrote:

> Kris Jurka wrote:
> 
> > Your options seem to be:
> >  - don't use dollar quoting
> >  - use the 7.4 driver which doesn't try to split queries
> >  - teach the driver about dollar quoting
> 
> It's a pity the grammar doesn't let you specify the function body as a 
> parameter, then you could just use a PreparedStatement and avoid the 
> quoting problems altogether..

Yes and no.  The problem with that approach is that you have to know what 
you're doing ahead of time instead of just blindly passing a query string 
into Statement.execute().  Consider an admin interface (or say psql) 
written in java, it should be able to take an arbitrary sql string and run 
it without problem.  This is just another case of the driver not correctly 
lexing/parsing a query.  Also note that the current code does not 
correctly handle single quotes that are escaped with backslashes.

Kris Jurka



view thread (11+ messages)  latest in thread

Message-ID: <Pine.BSO.4.56.0409142132490.9485@leary.csoft.net>
Permalink:  ../Pine.BSO.4.56.0409142132490.9485@leary.csoft.net/
Also on:    postgresql.org/message-id/Pine.BSO.4.56.0409142132490.9485@leary.csoft.net

 · 

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: books@ejurka.com, oliver@opencloud.com, tim@penhey.net
  Subject: Re: Problem with dollar-quoted CREATE OR REPLACE FUNCTION
  In-Reply-To: <Pine.BSO.4.56.0409142132490.9485@leary.csoft.net>
  References: <41470089.8010207@penhey.net> <Pine.BSO.4.56.0409141340180.27@leary.csoft.net> <41477610.8070202@opencloud.com> <Pine.BSO.4.56.0409142132490.9485@leary.csoft.net>

* 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