Re: plpgsql function, comment with single quote, braces

From: Kris Jurka <books(at)ejurka(dot)com>
To: Роман Литовченко <roman(dot)lytovchenko(at)gmail(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org, Florent Guillaume <fg(at)nuxeo(dot)com>, polobo(at)yahoo(dot)com
Subject: Re: plpgsql function, comment with single quote, braces
Date: 2012-01-20 19:25:52
Message-ID: alpine.BSO.2.00.1201201414330.3468@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Fri, 20 Jan 2012, ????? ?????????? wrote:

> [simple example code]
>
> What about these?
>

Yes, this is a bug. The escape processor is getting confused about what
it should process and is incorrectly modifying your code. Escape
processing should only occur in a raw SQL, never within a literal value.
The escape processor should skip over the entire function body because it
is within dollar quotes and is a literal, but it doesn't understand dollar
quotes so it is examining the contents and is getting further confused by
the single quotes within it.

The parameter locating code (looking for ?) knows about dollar quotes, so
it would be nice to unify with that instead of having two partial query
parsers.

Kris Jurka

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message John Lister 2012-01-20 19:32:26 Array helper patch
Previous Message Vitalii Tymchyshyn 2012-01-20 14:50:08 Re: NIO support