Re: How to raise error from PostgreSql SQL statement if some condition is met - Mailing list pgsql-general

From Andrus
Subject Re: How to raise error from PostgreSql SQL statement if some condition is met
Date
Msg-id DE497057158C4D718BEA60992B638573@dell2
Whole thread Raw
In response to Re: How to raise error from PostgreSql SQL statement if some condition is met  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: How to raise error from PostgreSql SQL statement if some condition is met  (Pavel Stehule <pavel.stehule@gmail.com>)
List pgsql-general
Than you very much.
It worked.

I tried to extend it to pass message parameters. Tried code below but got
syntax error. How to pass message parameters ?

Andrus.

CREATE OR REPLACE FUNCTION RaiseException(text, variadic )
  RETURNS void LANGUAGE plpgsql AS
$BODY$
BEGIN
   RAISE EXCEPTION  $1, $2;
END;
$BODY$;

SELECT RaiseException('Exception Param1=% Param2=%', 'textvalue', 2 );



pgsql-general by date:

Previous
From: Craig Ringer
Date:
Subject: Re: How to raise error from PostgreSql SQL statement if some condition is met
Next
From: Pavel Stehule
Date:
Subject: Re: How to raise error from PostgreSql SQL statement if some condition is met