On 17/04/2008, Michael Bayer <[EMAIL PROTECTED]> wrote: > On Apr 15, 2008, at 10:32 PM, Dave Harrison wrote: > > > > > Hey all, > > > > The below code establishes 3 tables (house, dog, owner) and a > > mapper table to associate owners and dogs (friendships). > > > > When I use either MySQL (5.0.51) or SQLite (3.4.2) as the backend, > > this code works correctly. However when I use Postgres (either 8.2.7 > > or 8.3.1) I get the following integrity error: > > > > sqlalchemy.exceptions.IntegrityError: (IntegrityError) update or > > delete on table "dog" violates foreign key constraint > > "friendship_dog_id_fkey" on table "friendship" DETAIL: Key (id)=(1) > > is still referenced from table "friendship". 'DELETE FROM dog WHERE > > dog.id = %(id)s' [{'id': 1}, {'id': 2}] > > always use "delete" cascade in conjunction with "delete-orphan". It > doesnt make much sense to have delete-orphan only and not "delete" > cascade. If that doesn't solve your problem here, let me know and Ill > try running the example script.
If I use "delete, delete-orphan" I get the same errors --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en -~----------~----~----~----~------~----~------~--~---