Re: ERROR: control reached end of function without RETURN, except, it is not a function it is a procedure or a nameless block.

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Pavel Stehule <pavel.stehule@gmail.com>
Cc: Herwig Goemans <herwig.goemans@gmail.com>, pgsql-general <pgsql-general@lists.postgresql.org>
Date: 2021-09-13T16:04:48Z
Lists: pgsql-general
Pavel Stehule <pavel.stehule@gmail.com> writes:
> po 13. 9. 2021 v 13:23 odesílatel Herwig Goemans <herwig.goemans@gmail.com>
> napsal:
>> I get an error in a stored procedure - not a stored function mind you -
>> control reached end of function without RETURN
>> The error occurs when doing an exit <label> in  a stored procedure.

> This is Postgres's bug

Yeah, agreed.  Looks reasonably simple to fix, though.

			regards, tom lane



Commits

  1. Fix EXIT out of outermost block in plpgsql.