Re: CALL optional in PL/pgSQL

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: CALL optional in PL/pgSQL
Date: 2018-03-01 06:28:44
Message-ID: CAFj8pRDdg2rEGWg_gM2raFPdKSE4du5x59G7uE3kQCxbO=Ksqw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2018-03-01 5:51 GMT+01:00 Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)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)

please, fix me, if I am wrong.

SQL/PSM requires it.

I agree, so in this case, the CALL can be optional - because procedures are
called by different mechanism than functions - and there is not additional
overhead. It is not strictly necessary, because tools like ora2pg has not
any problem with procedure identification and some transformations.

But - if we allow optional CALL in PL/pgSQL, then we will have
inconsistence between PL/pgSQL and other environments, when the CALL will
be required. What is not too nice.

> I seem to recall that there were past discussions about this, with
> respect to the PERFORM command, but I couldn't find them anymore.
>
> 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. I don't see any benefit. Different case are
functions - then users can implement some pseudovariables like
CURRENT_USER, ..

> If anyone has more details about the PL/SQL side of this, that would be
> useful. What I could find is that using CALL and not using CALL appear
> to be equivalent.
>
> --
> Peter Eisentraut http://www.2ndQuadrant.com/
> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Rajkumar Raghuwanshi 2018-03-01 06:30:23 Re: server crash in nodeAppend.c
Previous Message Thomas Munro 2018-03-01 05:55:18 Re: Synchronous replay take III