Re: referential integrity constraints not checked inside PL/pgSQL functions?

Поиск
Список
Период
Сортировка
От Patrick Welche
Тема Re: referential integrity constraints not checked inside PL/pgSQL functions?
Дата
Msg-id 20040513102634.GE20725@quartz.newn.cam.ac.uk
обсуждение исходный текст
Ответ на referential integrity constraints not checked inside PL/pgSQL functions?  (Christian Rank <christian.rank@rz.uni-passau.de>)
Ответы Re: referential integrity constraints not checked inside  (Christian Rank <christian.rank@rz.uni-passau.de>)
Список pgsql-general
On Thu, May 13, 2004 at 11:41:24AM +0200, Christian Rank wrote:
>     create function f () returns void as '
>     begin
>       delete from a;
>       delete from b;
>       return;
>     end;
>     ' language plpgsql;
>
> I would expect that
>
>     select f();
>
> yields an error message about constraint violation when executing
> 'delete from a;'.

Off the top of my head, the constraints would be checked when the
transaction ends, i.e., after both the "delete from a" and "delete from b"
happened. Split into 2 transactions?

Cheers,

Patrick

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

Предыдущее
От: Christian Rank
Дата:
Сообщение: referential integrity constraints not checked inside PL/pgSQL functions?
Следующее
От: Andrew Sullivan
Дата:
Сообщение: Re: dbmirror