Re: Function definition regression in 15beta1 when specific parameter name (string) is used

Поиск
Список
Период
Сортировка
От Adrian Klaver
Тема Re: Function definition regression in 15beta1 when specific parameter name (string) is used
Дата
Msg-id daeee94b-ae8e-424d-ccf0-fb4f8fa81d11@aklaver.com
обсуждение исходный текст
Ответ на Function definition regression in 15beta1 when specific parameter name (string) is used  (Alastair McKinley <a.mckinley@analyticsengines.com>)
Ответы Re: Function definition regression in 15beta1 when specific parameter name (string) is used  (Adrian Klaver <adrian.klaver@aklaver.com>)
Список pgsql-general
On 5/29/22 09:46, Alastair McKinley wrote:
> Hi all,
> 
> I was testing an existing codebase with 15beta1 and ran into this issue.
> 
> I reduced the test case to an example with works in 14.3, and fails in 15beta1.
> 
> The following function definition fails in 15beta1 (ok in 14.3):
> 
>      create or replace function regexp_match_test(string text,pattern text) returns text[] as
>      $$
>          select regexp_match(string,pattern);
>      $$ language sql;
> 
> The error message is:
> 
>      ERROR:  syntax error at or near ","
>      LINE 3:     select regexp_match(string,pattern);
>                                                                ^
> Changing the first parameter name from string to anything else (e.g. strin or string1) resolves the issue.
> 
> The issue also occurs with the "string" parameter name if this is used in a plpgsql function like this:
> 
>      create or replace function regexp_match_test(string text,pattern text) returns text[] as
>      $$
>      begin
>              return (select regexp_match(string,pattern));
>      end;
>      $$ language plpgsql;
> 
> Best regards,

Postgres 15:

https://www.postgresql.org/docs/15/sql-keywords-appendix.html

STRING     reserved (can be function or type)     non-reserved           

Postgres 14:

https://www.postgresql.org/docs/14/sql-keywords-appendix.html

STRING           non-reserved           

I don't have a 15 instance available, but I would double quoting 
"string" would work.

> 
> Alastair
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com



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

Предыдущее
От: Alastair McKinley
Дата:
Сообщение: Function definition regression in 15beta1 when specific parameter name (string) is used
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: Function definition regression in 15beta1 when specific parameter name (string) is used