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 DE497057158C4D718BEA60992B638573@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  (Pavel Stehule <pavel.stehule@gmail.com>)
Список 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 по дате отправления:

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