Re: Raise exception without using plpgsql?

From: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
To: Joel Jacobson <joel(at)compiler(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Raise exception without using plpgsql?
Date: 2020-12-17 16:45:03
Message-ID: 20201217164503.GA18792@depesz.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Pavel Stehule 2020-12-17 16:58:22 Re: Raise exception without using plpgsql?
Previous Message Gustavsson Mikael 2020-12-17 16:33:13 SV: SV: SV: Problem with ssl and psql in Postgresql 13