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

Поиск
Список
Период
Сортировка
От Andrus
Тема Re: How to raise error from PostgreSql SQL statement if some condition is met
Дата
Msg-id F8704FB9C6B043D8B01D84A515FFE8F7@dell2
обсуждение исходный текст
Ответ на Re: How to raise error from PostgreSql SQL statement if some condition is met  (Pavel Stehule <pavel.stehule@gmail.com>)
Ответы Re: How to raise error from PostgreSql SQL statement if some condition is met  (Craig Ringer <ringerc@ringerc.id.au>)
Список 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 по дате отправления:

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: How to raise error from PostgreSql SQL statement if some condition is met
Следующее
От: Neanderthelle Jones
Дата:
Сообщение: Deleting BLOBs