Skip to content

Documentation: Boolean Mixup - ~on~ should be off #21403

@CNX-Inc

Description

@CNX-Inc

Existing documentation URL(s)

In the D1 Documentation about Foreign Keys, I think there's a typo where on should be off

Specifically, the statement:

You can also explicitly set PRAGMA defer_foreign_keys = on immediately after you have resolved outstanding foreign key constraints. If there are still outstanding foreign key constraints, you will receive a FOREIGN KEY constraint failed error and will need to resolve the violation.

I believe that on should be off - because my understanding (which may be in error) from reading the page is that deferring (the checking of) foreign keys allows you to violate constraints, and in the example above it sets that to off (i.e. enforcing the check` at the end of the transaction:

PRAGMA defer_foreign_keys = off -- This is implicit if not set by the end of the transaction.

What changes are you suggesting?

In the statement:

You can also explicitly set PRAGMA defer_foreign_keys = on immediately after you have resolved outstanding foreign key constraints. If there are still outstanding foreign key constraints, you will receive a FOREIGN KEY constraint failed error and will need to resolve the violation.

I believe that on should be off so it should read:

You can also explicitly set PRAGMA defer_foreign_keys = off immediately after you have resolved outstanding foreign key constraints. If there are still outstanding foreign key constraints, you will receive a FOREIGN KEY constraint failed error and will need to resolve the violation.

Additional information

No response

Metadata

Metadata

Labels

content:editRequest for content editsdocumentationDocumentation editsproduct:d1D1: https://developers.cloudflare.com/d1/

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions