Re: Re: [BUGS] BUG #4027: backslash escaping not disabled inplpgsql

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: Re: [BUGS] BUG #4027: backslash escaping not disabled inplpgsql
Дата
Msg-id 49DDDB7C.EE98.0025.0@wicourts.gov
обсуждение исходный текст
Ответ на Re: Re: [BUGS] BUG #4027: backslash escaping not disabled inplpgsql  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Re: [BUGS] BUG #4027: backslash escaping notdisabled inplpgsql  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
Список pgsql-hackers
Tom Lane <tgl@sss.pgh.pa.us> wrote: 
> "Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:
>> Can't that be managed with this CREATE FUNCTION option?:
>> SET configuration_parameter { TO value | = value | FROM CURRENT }
> 
> It can be, the question is whether we're prepared to break
everything
> under the sun until people add that.
Well, surely the 8.3 behavior is not what we want.
(1)  The plpgsql parser identifies the boundaries of the string based
on backslash escapes.
(2)  The character string literal is interpreted based on the GUC
setting the first time the function is executed (and presumably the
first time executed after the function's invalidated).
(3)  Subsequent changes to the GUC don't affect how it's interpreted.
scca=# show standard_conforming_strings ;standard_conforming_strings
-----------------------------on
(1 row)

scca=# create or replace function kjgtest() returns text language
plpgsql immutable strict as $$ begin return '\x49'; end; $$;
CREATE FUNCTION
scca=# select * from kjgtest();kjgtest
---------\x49
(1 row)

scca=# set standard_conforming_strings = off;
SET
scca=# select * from kjgtest();kjgtest
---------\x49
(1 row)

scca=# create or replace function kjgtest() returns text language
plpgsql immutable strict as $$ begin return '\x49'; end; $$;
CREATE FUNCTION
scca=# select * from kjgtest();kjgtest
---------I
(1 row)

scca=# set standard_conforming_strings = on;
SET
scca=# select * from kjgtest();kjgtest
---------I
(1 row)

scca=# create or replace function kjgtest() returns text language
plpgsql immutable strict as $$ begin return '\x49'; end; $$;
CREATE FUNCTION
scca=# set standard_conforming_strings = off;
SET
scca=# select * from kjgtest();kjgtest
---------I
(1 row)
-Kevin


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Strange query plan with redundant aggregate nodes
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Resetting cluster-wide statistics