Project

General

Profile

Actions

Feature #2574

closed
BT KD

Dbo: Consider defaulting to deferred foreign key constraints when available

Feature #2574: Dbo: Consider defaulting to deferred foreign key constraints when available

Added by Bruce Toll over 12 years ago. Updated over 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
01/19/2014
Due date:
% Done:

0%

Estimated time:

Description

Foreign key constraints with "DEFERRABLE INITIALLY DEFERRED" may permit more flexible ordering of Dbo operations (where supported). Though the use cases may be different, I believe that Django sets this default for some of their supported backends, including Postgres.

The attached patch provides for "DEFERRABLE INITIALLY DEFERRED" foreign key constraints with the Postgres and Sqlite3 Dbo backends. The patch also enables dbo_test17 for these backends.

This patch could impact portability between supported Dbo backends, for users who rely on Dbo to create schemas.

Patch is formatted with "git format-patch" against github master 3.3.1-22-g11485bb. It has only been lightly tested.


Files

KD Updated by Koen Deforche over 12 years ago Actions #1

  • Status changed from New to Feedback
  • Assignee set to Koen Deforche
  • Target version set to 3.3.2

Hey,

That sounds really interesting. I guess it will fix this old and annoying issue on databases that support this syntax: http://redmine.emweb.be/issues/1280 ?

Regards,
koen

BT Updated by Bruce Toll over 12 years ago Actions #2

Hey Koen,

Thanks for following-up. I tested the sample code attached to #1280 with the patched github version and it works without the flush().

Regards,

---Bruce

KD Updated by Koen Deforche over 12 years ago Actions #3

  • Status changed from Feedback to InProgress

KD Updated by Koen Deforche over 12 years ago Actions #4

  • Status changed from InProgress to Resolved

Hey Bruce,

Fantastic find and work, and sorry for my redundant question: the patch already indicated how it could enable the test case that we were struggling with!

Regards,
koen

KD Updated by Koen Deforche over 12 years ago Actions #5

  • Status changed from Resolved to Closed
Actions

Also available in: PDF Atom