Search Postgresql Archives

Re: How to raise error from PostgreSql SQL statement if some condition is met

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2012/8/12 Andrus <kobruleht2@xxxxxx>:
> 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 )

... RaiseException(text, variadic text[])
..

VARIADIC is keyword, not datatype

Regards

Pavel Stehule

>  RETURNS void LANGUAGE plpgsql AS
> $BODY$
> BEGIN
>   RAISE EXCEPTION  $1, $2;
> END;
> $BODY$;
>
> SELECT RaiseException('Exception Param1=% Param2=%', 'textvalue', 2 );

-
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux