From: hubert depesz lubaczewski <depesz@depesz.com>
To: Joel Jacobson <joel@compiler.org>
Cc: pgsql-general@postgresql.org
Subject: Re: Raise exception without using plpgsql?
Date: Thu, 17 Dec 2020 17:45:03 +0100
Message-ID: <20201217164503.GA18792@depesz.com> (raw)
In-Reply-To: <7479ca12-af3c-44c3-9ddd-a2074eb82a12@www.fastmail.com>
References: <7479ca12-af3c-44c3-9ddd-a2074eb82a12@www.fastmail.com>
On Thu, Dec 17, 2020 at 03:32:09PM +0100, Joel Jacobson wrote:
> Hi,
> Is there a way to raise an exception with a message,
> without having to add your own plpgsql helper-function?
> Currently this is what I have:
Well, you can:
DO $$ begin raise notice 'zz'; END; $$;
It's cheating though, as it still needs plpgsql.
Best regards,
depesz
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: depesz@depesz.com, joel@compiler.org
Subject: Re: Raise exception without using plpgsql?
In-Reply-To: <20201217164503.GA18792@depesz.com>
References: <7479ca12-af3c-44c3-9ddd-a2074eb82a12@www.fastmail.com> <20201217164503.GA18792@depesz.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