From: Adrian Klaver <adrian.klaver@aklaver.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Is there a GoTo ?
Date: Thu, 16 Jan 2020 08:17:13 -0800
Message-ID: <872cd0ac-1edc-2c75-290e-1ab88138684f@aklaver.com> (raw)
In-Reply-To: <CALcdmyRoL87r4H074joV4ryA3tYO+dbKr6AEocwAt9wOe52iDQ@mail.gmail.com>
References: <CALcdmyRoL87r4H074joV4ryA3tYO+dbKr6AEocwAt9wOe52iDQ@mail.gmail.com>
On 1/16/20 2:48 AM, İlyas Derse wrote:
> In this function I have to GOTO to a label1, but GOTO keyword is not
> working, can you please help me in getting the way from which I am able
> to jump from a particular code to label.
> Thanks...
>
> |CREATEORREPLACE FUNCTIONtest(i integer)RETURNS integer
> AS$$BEGINIFi<0THENRETURNi
> +1;ELSEGOTOlabel1;ENDIF<<label1>>RETURNnull;END;$$LANGUAGE plpgsql;|
>
Are you looking for EXIT?:
https://www.postgresql.org/docs/12/plpgsql-control-structures.html#PLPGSQL-CONDITIONALS
42.6.5.2. EXIT
--
Adrian Klaver
adrian.klaver@aklaver.com
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: adrian.klaver@aklaver.com
Subject: Re: Is there a GoTo ?
In-Reply-To: <872cd0ac-1edc-2c75-290e-1ab88138684f@aklaver.com>
References: <CALcdmyRoL87r4H074joV4ryA3tYO+dbKr6AEocwAt9wOe52iDQ@mail.gmail.com> <872cd0ac-1edc-2c75-290e-1ab88138684f@aklaver.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