Re: Re: [BUGS] BUG #4027: backslash escaping notdisabled inplpgsql - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Re: [BUGS] BUG #4027: backslash escaping notdisabled inplpgsql
Date
Msg-id 27856.1239387683@sss.pgh.pa.us
Whole thread Raw
In response to Re: Re: [BUGS] BUG #4027: backslash escaping notdisabled inplpgsql  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Responses Re: Re: [BUGS] BUG #4027: backslash escaping notdisabled inplpgsql  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
List pgsql-hackers
"Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:
> Tom Lane <tgl@sss.pgh.pa.us> wrote: 
>> I think you are confusing parsing of the string literal that
>> is the argument of CREATE FUNCTION with the parsing that the plpgsql
>> interpreter does on the function body once it gets it.
> Oh, I'm not confused about that at all.  I'm arguing that it's a bad
> idea.  I agree with the OP that this is a bug.  Did you look at my
> other examples of behavior?

I ignored all the ones that used non-dollar-quote syntax for the overall
function body, since they are just confusing the issue.

> Can you show one case where having plgpsql parse the function body
> based on the standard_conforming_strings GUC would break *anything*
> that now works?

regression=# create function foo() returns int as $$
regression$# begin
regression$#   raise notice 'foo\'s bar';
regression$#   return 1;
regression$# end$$ language plpgsql;
CREATE FUNCTION
regression=# select foo();
NOTICE:  foo's barfoo 
-----  1
(1 row)

In this case the string literal isn't actually ever passed to the main
SQL engine, so the SQL quoting rules aren't relevant.  (I don't remember
offhand if anything besides RAISE works that way.)

It may be that this isn't a very important case, but to claim that
it doesn't exist is simply wrong.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: WIP: to_char, support for EEEE format
Next
From: "Kevin Grittner"
Date:
Subject: Re: Re: [BUGS] BUG #4027: backslash escaping notdisabled inplpgsql