Re: a math function with error handling

Поиск
Список
Период
Сортировка
От Chris Mair
Тема Re: a math function with error handling
Дата
Msg-id 1160889062.14610.5.camel@ultra.home.lan
обсуждение исходный текст
Ответ на a math function with error handling  (Arthur Molina <arthurmolina@yahoo.com.br>)
Список pgsql-general
> If I send something like 25 / '5' I get the result, 5
> but if I send 25 / '0' I get null (division_by_zero)
> or when I send 25 / 'textcrap' I get null too....

You might want to look at pl/pgsql exception handlers:
http://www.postgresql.org/docs/8.1/static/plpgsql-control-structures.html#PLPGSQL-ERROR-TRAPPING

Trapping division by zero is given as an example there...


Bye, Chris.


--

Chris Mair
http://www.1006.org


В списке pgsql-general по дате отправления:

Предыдущее
От: Arthur Molina
Дата:
Сообщение: a math function with error handling
Следующее
От: Ron Johnson
Дата:
Сообщение: Re: A query planner that learns