pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christophe Pettus <xof@thebuild.com>
To: Bryn Llewellyn <bryn@yugabyte.com>
Cc: pgsql-general list <pgsql-general@lists.postgresql.org>
Subject: Re: Using "exit" to bring "goto" functionality.
Date: Mon, 10 Jul 2023 11:58:33 -0700
Message-ID: <39EC45EE-8162-4B19-97C2-BE54E758B294@thebuild.com> (raw)
In-Reply-To: <655E5E21-FCED-405F-81F6-AE2713F27337@yugabyte.com>
References: <655E5E21-FCED-405F-81F6-AE2713F27337@yugabyte.com>



> On Jul 10, 2023, at 11:54, Bryn Llewellyn <bryn@yugabyte.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




view thread (7+ messages)  latest in thread

Message-ID: <39EC45EE-8162-4B19-97C2-BE54E758B294@thebuild.com>
Permalink:  ../39EC45EE-8162-4B19-97C2-BE54E758B294@thebuild.com/
Also on:    postgresql.org/message-id/39EC45EE-8162-4B19-97C2-BE54E758B294@thebuild.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: xof@thebuild.com, bryn@yugabyte.com
  Subject: Re: Using "exit" to bring "goto" functionality.
  In-Reply-To: <39EC45EE-8162-4B19-97C2-BE54E758B294@thebuild.com>
  References: <655E5E21-FCED-405F-81F6-AE2713F27337@yugabyte.com> <39EC45EE-8162-4B19-97C2-BE54E758B294@thebuild.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox