Re: ON DELETE CASCADE with multiple paths

Поиск
Список
Период
Сортировка
Искать
От
Max Khon
Тема
Re: ON DELETE CASCADE with multiple paths
Дата
в 05:47:23
Msg-id
464D6636.3000809@swsoft.com
Ответ на
Список
Дерево обсуждения
ON DELETE CASCADE with multiple paths Max Khon <mkhon@swsoft.com>
Re: ON DELETE CASCADE with multiple paths Tom Lane <tgl@sss.pgh.pa.us>
Re: ON DELETE CASCADE with multiple paths Stephan Szabo <sszabo@megazone.bigpanda.com>
Re: ON DELETE CASCADE with multiple paths Max Khon <mkhon@swsoft.com>
Re: ON DELETE CASCADE with multiple paths Max Khon <mkhon@swsoft.com>
Re: ON DELETE CASCADE with multiple paths Stephan Szabo <sszabo@megazone.bigpanda.com>
Re: ON DELETE CASCADE with multiple paths Max Khon <mkhon@swsoft.com>
Re: ON DELETE CASCADE with multiple paths Stephan Szabo <sszabo@megazone.bigpanda.com>
Hi!

Stephan Szabo wrote:

>>> "delete from foo" fails:
>>> ERROR: update or delete on table "bar" violates foreign key constraint
>>> "foobar_fk0" on table "foobar"
>>> SQL state: 23503
>>> Detail: Key (bar_id)=(1) is still referenced from table "foobar".
>>> Context: SQL statement "DELETE FROM ONLY "public"."bar" WHERE "foo_id" = $1"
>> I see no bug here.  There is no guarantee about the order in which
>> constraints are applied.
> 
> Except that SQL92 at least does seem to say in 11.8 that "All rows that
> are marked for deletion are effectively deleted at the end of the
> SQL-statement, prior to the checking of any integrity constraints." I
> think that likely makes our behavior wrong, but I'm not really sure how to
> get there from what we have now.

Just for the record: it works on Oracle 8i (and I assume it works on
later versions) and SQL Server 2005.

-- 
Max Khon
PEM Platform Team Leader
SWsoft, Inc.
E-mail: mkhon@swsoft.com
Web Site: http://swsoft.com/
В списке pgsql-bugs по дате отправления
От: Peter Koczan
Дата:
От: Heikki Linnakangas
Дата:
FAQ