Re: strange construct with RETURN within plpgsql - Mailing list pgsql-general

From mariusz
Subject Re: strange construct with RETURN within plpgsql
Date
Msg-id 1518786484.10667.95.camel@mtvk.pl
Whole thread Raw
In response to Re: strange construct with RETURN within plpgsql  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: strange construct with RETURN within plpgsql
List pgsql-general
On Fri, 2018-02-16 at 05:40 -0700, David G. Johnston wrote:
> On Fri, Feb 16, 2018 at 5:31 AM, mariusz <marius@mtvk.pl> wrote:
> 
>         so, if there is a reason for such a construct and it does
>         something i
>         didn't notice, please let me know what is the purpose of
>         keyword RETURN
>         after a valid statement.
> 
> 
> ​
> https://www.postgresql.org/docs/10/static/plpgsql-control-structures.html#PLPGSQL-STATEMENTS-RETURNING
> 
yes, i know what RETURN does and when it does not exit from function
(like RETURN NEXT or RETURN QUERY), i know that part of docs, even read
that again and again before sending, but i must be blind, because i
cannot see any mention of
<statement> RETURN;
where that RETURN keyword does nothing (note the lack of ; before
return)
maybe knowing all that i just pass the docs too fast, but i honestly
cannot see why is this allowed.

the only similar thing which comes to my mind is a statement with
RETURNING ... clause within cte, but it's not the case here (nor the
same spelling)

regards, mj




pgsql-general by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: Dynamic PL/pgSQL select query: value association propblem
Next
From: "David G. Johnston"
Date:
Subject: Re: strange construct with RETURN within plpgsql