pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Alastair McKinley <a.mckinley@analyticsengines.com>
To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Function definition regression in 15beta1 when specific parameter name (string) is used
Date: Sun, 29 May 2022 10:29:12 -0700
Message-ID: <daeee94b-ae8e-424d-ccf0-fb4f8fa81d11@aklaver.com> (raw)
In-Reply-To: <PAXPR02MB760049C92DFC2D8B5E8B8F5AE3DA9@PAXPR02MB7600.eurprd02.prod.outlook.com>
References: <PAXPR02MB760049C92DFC2D8B5E8B8F5AE3DA9@PAXPR02MB7600.eurprd02.prod.outlook.com>

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





view thread (5+ messages)  latest in thread

Message-ID: <daeee94b-ae8e-424d-ccf0-fb4f8fa81d11@aklaver.com>
Permalink:  ../daeee94b-ae8e-424d-ccf0-fb4f8fa81d11@aklaver.com/
Also on:    postgresql.org/message-id/daeee94b-ae8e-424d-ccf0-fb4f8fa81d11@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, a.mckinley@analyticsengines.com
  Subject: Re: Function definition regression in 15beta1 when specific parameter name (string) is used
  In-Reply-To: <daeee94b-ae8e-424d-ccf0-fb4f8fa81d11@aklaver.com>
  References: <PAXPR02MB760049C92DFC2D8B5E8B8F5AE3DA9@PAXPR02MB7600.eurprd02.prod.outlook.com> <daeee94b-ae8e-424d-ccf0-fb4f8fa81d11@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox