Re: Re: [BUGS] BUG #4027: backslash escaping notdisabled inplpgsql

From: Brendan Jurd <direvus(at)gmail(dot)com>
To: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Jonathan Guthrie <jguthrie(at)brokersys(dot)com>, Peter Eisentraut <peter_e(at)gmx(dot)net>, Bruce Momjian <bruce(at)momjian(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [BUGS] BUG #4027: backslash escaping notdisabled inplpgsql
Date: 2009-04-10 19:11:22
Message-ID: 37ed240d0904101211k37963f63h242f7db4c3d4c17c@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

On Sat, Apr 11, 2009 at 4:40 AM, Kevin Grittner
<Kevin(dot)Grittner(at)wicourts(dot)gov> wrote:
> The aspect of 8.3 behavior that concerns me most is that neither the
> author of a function, nor anyone using it, can control or predict
> which way a string literal with a backslash will be interpreted,
> unless the author explicitly specifies the SET
> standard_conforming_strings clause in the function declaration.  I'm
> betting that most people writing and using plpgsql functions don't
> know that.  Any thoughts about what can or should be done about that?

Isn't this exactly the same problem that application authors have been
facing with SQL in their code?

Namely, if there's a backslash anywhere in a string literal you
*cannot* leave it as a bare single-quoted string literal. You need to
decide whether you want the backslash treated as an escape character
(and therefore use E quoting), or as a backslash (and therefore use $$
quoting).

Until you've done that for every single string literal with a
backslash, your application isn't ready for
standard_conforming_strings to be switched on.

I agree that there are probably a great many app authors out there who
don't realise how very boned they might be if the default GUC gets
changed and they haven't prepared their SQL to cope.

Cheers,
BJ

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruce Momjian 2009-04-10 19:13:10 Re: Re: [BUGS] BUG #4027: backslash escaping notdisabled inplpgsql
Previous Message Tom Lane 2009-04-10 18:57:10 Re: Re: [BUGS] BUG #4027: backslash escaping notdisabled inplpgsql

Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2009-04-10 19:12:06 Re: A renewed plea for inclusion of zone.tab
Previous Message Tom Lane 2009-04-10 19:01:05 Re: A renewed plea for inclusion of zone.tab