Re: CALL optional in PL/pgSQL - Mailing list pgsql-hackers

From Tom Lane
Subject Re: CALL optional in PL/pgSQL
Date
Msg-id 19563.1519918306@sss.pgh.pa.us
Whole thread Raw
In response to Re: CALL optional in PL/pgSQL  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: CALL optional in PL/pgSQL  (Andrew Dunstan <andrew.dunstan@2ndquadrant.com>)
List pgsql-hackers
Pavel Stehule <pavel.stehule@gmail.com> writes:
> 2018-03-01 5:51 GMT+01:00 Peter Eisentraut <peter.eisentraut@2ndquadrant.com
>> This seems to be a popular issue when porting from PL/SQL, so I'll throw
>> it out here for discussion.  Apparently, in PL/SQL you can call another
>> procedure without the CALL keyword.  Here is a patch that attempts to
>> implement that in PL/pgSQL as well.  It's not very pretty.

> The CALL is not optional in PL/SQL - I was surprised - it is required in
> some environments, and it should not be used in other (like PL/SQL)

I think this is an actively bad idea.  It introduces an inherent ambiguity
into the grammar; for instance

    PERFORM (2);

now has two valid interpretations.  The only way to resolve that is with
heuristics or treating a bunch more words as reserved keywords, neither of
which are appetizing.  (I didn't look to see which way Peter did it, but
his description of his patch as "not very pretty" doesn't fill me with
happiness.)  And it would likely cause headaches down the road whenever
we attempt to add new syntax to plpgsql.

I think we should reject the idea.

>> Also, I think PL/SQL allows you to call a procedure with no arguments
>> without parentheses.  I have not implemented that.  I think it could be
>> done, but it's not very appealing.

> I don't like this feature.

This idea is even worse in terms of the amount of syntax space it will
occupy, again for zero functional benefit.

            regards, tom lane


pgsql-hackers by date:

Previous
From: Satyanarayana Narlapuram
Date:
Subject: Re: zheap: a new storage format for PostgreSQL
Next
From: Alvaro Herrera
Date:
Subject: Re: 2018-03 Commitfest starts tomorrow