Re: Using "exit" to bring "goto" functionality.

From: Christophe Pettus <xof(at)thebuild(dot)com>
To: Bryn Llewellyn <bryn(at)yugabyte(dot)com>
Cc: pgsql-general list <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: Using "exit" to bring "goto" functionality.
Date: 2023-07-10 18:58:33
Message-ID: 39EC45EE-8162-4B19-97C2-BE54E758B294@thebuild.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> On Jul 10, 2023, at 11:54, Bryn Llewellyn <bryn(at)yugabyte(dot)com> wrote:
>
> What is the rationale for supporting what seems to be on its face this strange functionality?

It allows you to EXIT or CONTINUE a loop that is not the innermost one, by naming the label of an outer loop.

One can debate endlessly whether it's good or bad to include that functionality, but it definitely has use cases. I would assume that at this point, it's not going anywhere.

The relevant documentation is here:

https://www.postgresql.org/docs/15/plpgsql-control-structures.html#PLPGSQL-CONTROL-STRUCTURES-LOOPS

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message DAVID ROTH 2023-07-10 19:08:05 Re: Using "exit" to bring "goto" functionality.
Previous Message Bryn Llewellyn 2023-07-10 18:54:08 Using "exit" to bring "goto" functionality.