Re: pgsql: SQL-standard function body

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>, pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: Re: pgsql: SQL-standard function body
Date: 2021-04-10 01:38:31
Message-ID: 7466db64eb6abae93e583faf8ca4004d60c163c4.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

On Fri, 2021-04-09 at 19:44 +0200, I wrote:
> > SQL-standard function body
> >
> > psql needs some new intelligence to keep track of function body
> > boundaries so that it doesn't send off statements when it sees
> > semicolons that are inside a function body.
>
> This causes psql to fail to recognize the semicolon in the following
> statement as the end of a statement:
>
> IMPORT FOREIGN SCHEMA x FROM SERVER y INTO z OPTIONS (case 'lower');
>
> The cause is the "case", which is recognized as the start of a function
> body.
>
> Would it be an option to recognize BEGIN and CASE as starting a
> function body only if they are *not* inside parentheses, like in
> the attached?

Here is an improved patch, which treats END in the same fashion
(not properly indented for readability).

Yours,
Laurenz Albe

Attachment Content-Type Size
0001-Improve-parsing-of-SQL-standard-functions-in-psql.patch text/x-patch 1.0 KB

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2021-04-10 02:52:05 Re: pgsql: autovacuum: handle analyze for partitioned tables
Previous Message Alvaro Herrera 2021-04-10 00:01:04 Re: pgsql: autovacuum: handle analyze for partitioned tables