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]

 



On 08/12/2012 06:02 PM, Andrus wrote:
... 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;

You probably want something like:

    RAISE EXCEPTION  "%: %", $1, $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