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 F8704FB9C6B043D8B01D84A515FFE8F7@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  (Craig Ringer <ringerc@ringerc.id.au>)
List pgsql-general
>... RaiseException(text, variadic text[])
>..

>VARIADIC is keyword, not datatype

Thank you.

I tried code below but got error shown in comment.
No idea what I'm doing wrong.

Andrus.


CREATE OR REPLACE FUNCTION RaiseException(text, variadic text[] )
  RETURNS void LANGUAGE plpgsql AS
$BODY$
BEGIN
  -- ERROR:  syntax error at or near "$1"
  RAISE EXCEPTION  $1, $2;
END;
$BODY$;

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


pgsql-general by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: How to raise error from PostgreSql SQL statement if some condition is met
Next
From: Neanderthelle Jones
Date:
Subject: Deleting BLOBs