Re: Problem with dollar-quoted CREATE OR REPLACE FUNCTION - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: Problem with dollar-quoted CREATE OR REPLACE FUNCTION
Date
Msg-id Pine.BSO.4.56.0409142132490.9485@leary.csoft.net
Whole thread Raw
In response to Re: Problem with dollar-quoted CREATE OR REPLACE FUNCTION  (Oliver Jowett <oliver@opencloud.com>)
Responses Re: Problem with dollar-quoted CREATE OR REPLACE FUNCTION
List pgsql-jdbc

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

pgsql-jdbc by date:

Previous
From: Kris Jurka
Date:
Subject: Re: Customizing SSL with jdbc
Next
From: chinmoy gangolli
Date:
Subject: Re: Customizing SSL with jdbc