Re: Problems handling errors in PL/pgSQL
| От | Tom Lane |
|---|---|
| Тема | Re: Problems handling errors in PL/pgSQL |
| Дата | |
| Msg-id | 24242.988070243@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | Problems handling errors in PL/pgSQL ("Josh Berkus" <josh@agliodbs.com>) |
| Ответы |
Re: Problems handling errors in PL/pgSQL
|
| Список | pgsql-sql |
"Josh Berkus" <josh@agliodbs.com> writes:
> However, not all types of errors are so trapped. The most problematic
> un-trapped error is referential integrity: if an INSERT or UPDATE fails
> because of a referential integrity violation, the PL/pgSQL function will
> still see the statement as a success and not error out.
This would clearly be a bug, but I cannot replicate the problem:
regression=# SELECT fn_save_order_details (7703, '{34,29,40}','{TRUE, TRUE, FALSE}');
ERROR: <unnamed> referential integrity violation - key referenced from order_details not found in orders
regression=#
regards, tom lane
В списке pgsql-sql по дате отправления: