Merge pull request #52004 from duffuniverse/fix-typo-in-active-record-and-postgresql-guide

[ci skip] Fix a typo in Active Record and PostgreSQL guide
This commit is contained in:
Carlos Antonio da Silva 2024-06-03 13:31:02 -03:00 committed by GitHub
commit 40a52362af
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -615,7 +615,7 @@ Deferrable Foreign Keys
* [foreign key table constraints](https://www.postgresql.org/docs/current/sql-set-constraints.html)
By default, table constraints in PostgreSQL are checked immediately after each statement. It intentionally does not allow creating records where the referenced record is not yet in the referenced table. It is possible to run this integrity check later on when the transactions is committed by adding `DEFERRABLE` to the foreign key definition though. To defer all checks by default it can be set to `DEFERRABLE INITIALLY DEFERRED`. Rails exposes this PostgreSQL feature by adding the `:deferrable` key to the `foreign_key` options in the `add_reference` and `add_foreign_key` methods.
By default, table constraints in PostgreSQL are checked immediately after each statement. It intentionally does not allow creating records where the referenced record is not yet in the referenced table. It is possible to run this integrity check later on when the transaction is committed by adding `DEFERRABLE` to the foreign key definition though. To defer all checks by default it can be set to `DEFERRABLE INITIALLY DEFERRED`. Rails exposes this PostgreSQL feature by adding the `:deferrable` key to the `foreign_key` options in the `add_reference` and `add_foreign_key` methods.
One example of this is creating circular dependencies in a transaction even if you have created foreign keys: