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

From: Alastair McKinley <a(dot)mckinley(at)analyticsengines(dot)com>
To: "pgsql-general(at)lists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Function definition regression in 15beta1 when specific parameter name (string) is used
Date: 2022-05-29 16:46:22
Message-ID: PAXPR02MB760049C92DFC2D8B5E8B8F5AE3DA9@PAXPR02MB7600.eurprd02.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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,

Alastair

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2022-05-29 17:29:12 Re: Function definition regression in 15beta1 when specific parameter name (string) is used
Previous Message Shaheed Haque 2022-05-29 16:03:20 Re: JSONB index not in use, but is TOAST the real cause of slow query?