Re: Transaction and cascade problem

Поиск
Список
Период
Сортировка
От Henshall, Stuart - WCP
Тема Re: Transaction and cascade problem
Дата
Msg-id E2870D8CE1CCD311BAF50008C71EDE8E01F74767@MAIL_EXCHANGE
обсуждение исходный текст
Ответ на Transaction and cascade problem  ("Glenn MacGregor" <gtm@oracom.com>)
Список pgsql-sql
IIRC this was for some perceived problem with foreign keys, however on hackers a while back it was talked about and I believe decided that it wasn't necessary after all and has been taken out. You might have more luck therefore with 7.2, or altering 7.1 to take this out (however I'm not 100% sure on this so check the hackers archives).
- Stuart
-----Original Message-----
From: Glenn MacGregor [mailto:gtm@oracom.com]
Sent: 20 December 2001 13:32
To: pgsql-sql@postgresql.org
Subject: Transaction and cascade problem

Hi All,
 
I have postgres 7.1 set up with two tables (groups, users).  groups has 2 columns name, groupid where id is the primary key autoincrement and name is unique.  users has 3 columns name, userid, groupid.  I have a constraint on users which says that groupid must exists in the group table.  I also have a cascade delete on the groups table to delete any users that are in the group I am removing.  I regular (no transaction) mode everything works fine.  When I start a transaction and I add a group to the group table, then delete it before a commit or rollback I get the following error:
 
ERROR: triggered data change violation on relation "groups"
 
After that the transaction must be rolledback.  Any clues?
 
    Thanks
 
                Glenn

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

Предыдущее
От: Jan Wieck
Дата:
Сообщение: Re: NULL values or not?
Следующее
От: Archibald Zimonyi
Дата:
Сообщение: Re: NULL values or not?