Open m-iancu opened 4 years ago
The graphic above claims that deferred FK constraints work. Issue #13009 shows that they don't work in one of the examples that text books and bloggers frequently use to illustrate why deferred FK constraints are essential:
the optional (or mandatory) one-to-one relationship
Moreover, especially for the case that the PKs of the tables are automatically generated, proper practice recommends a stored procedure encapsulation of the three SQLs (insert returning, insert returning, and update using the returned values) that must be done in a single transaction.
As of this comment's timestamp, example code for this use case works faultlessly in vanilla PG. But it fails in YB:
Jira Link: DB-2213 This is a master issue that keeps track of all deferrable constraints variants. The check mark means that the statement is already supported.
DEFERRABLE INITIALLY IMMEDIATE
DEFERRRABLE INITIALLY DEFERRED
DEFERRABLE INITIALLY IMMEDIATE
DEFERRABLE INITIALLY DEFERRED
Dependent ecosystem projects: