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

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Brendan Jurd <direvus(at)gmail(dot)com>
Cc: Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, 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>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [BUGS] BUG #4027: backslash escaping notdisabled inplpgsql
Date: 2009-04-10 19:13:10
Message-ID: 200904101913.n3AJDAO16929@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

Brendan Jurd wrote:
> 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.

I assume those authors are getting warnings, which is something we don't
for PL/pgSQL now.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Kevin Grittner 2009-04-10 19:15:48 Re: Re: [BUGS] BUG #4027: backslash escaping notdisabled inplpgsql
Previous Message Brendan Jurd 2009-04-10 19:11:22 Re: Re: [BUGS] BUG #4027: backslash escaping notdisabled inplpgsql

Browse pgsql-hackers by date

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