44000 — with_check_option_violation
44000 means that a row written through a view would not satisfy that view's WITH CHECK OPTION predicate. It protects the view's write invariant; it is not the table-level CHECK condition 23514.
English manual coverage begins with PostgreSQL 8.1. Source history and runtime observations have their own recorded version boundaries.
Reading PG 18·Select a recorded version
- aliases
- Unknown
- class name
- WITH CHECK OPTION Violation
- condition name
- with_check_option_violation
- lang
- en
- sqlstate
- 44000
Definition PG 18
44000 — with_check_option_violation
At a glance {#at-a-glance}
44000 means that a row written through a view would not satisfy that view's WITH CHECK OPTION predicate. It protects the view's write invariant; it is not the table-level CHECK condition 23514.
Meaning {#meaning}
When an automatically updatable view is defined with WITH CHECK OPTION, PostgreSQL checks that an inserted or updated row remains visible through the view. The executor treats both FALSE and NULL from the view predicate as failure, so a nullable predicate column does not make an unknown row pass. ExecWithCheckOptions reports new row violates check option for view "%s"; the dynamic failing-row DETAIL is included only when the permissions allow the row description. LOCAL checks conditions defined directly in the current view; underlying base-view conditions are not checked unless those base views also specify CHECK OPTION. CASCADED checks the current view and all underlying base-view conditions. CHECK OPTION is supported only on automatically updatable views without an INSTEAD OF trigger or rule; a trigger-updatable base view and an INSTEAD rewrite are separate boundaries where cascading or all checks can be ignored. The selected natural case is a directly updatable view.
Diagnosis {#diagnosis}
Capture SQLSTATE, view name, DETAIL when present, and the exact row values sent through the view. Read the definition with pg_get_viewdef() and evaluate its predicate using SQL three-valued logic: only TRUE is visible through the check option, while FALSE and NULL fail. Check whether the view is automatically updatable, whether it uses LOCAL or CASCADED, and whether a base view has an INSTEAD OF trigger or an INSTEAD rewrite. Do not search only for table CHECK constraints: LOCAL does not check ordinary underlying-view predicates, while CASCADED does unless a trigger-updatable or rewritten boundary prevents that cascade. Missing DETAIL can be a permission boundary rather than proof that no row was checked.
Response {#response}
Correct the row so its predicate is TRUE, or change the view definition only after confirming the schema contract and the intended LOCAL/CASCADED scope. Keep the check option when the view is meant to be an enforced filtered interface. If a trigger-updatable base view or an INSTEAD rewrite is involved, inspect that boundary and its effective checks; do not assume a cascaded check reached it. After an autocommit error the selected connection remained IDLE; inside an explicit transaction rollback the failed block before retrying with a valid row.
Messages {#messages}
The fixed source templates are new row violates check option for view "%s" and Failing row contains %s.. The view identifier and row rendering are dynamic. Treat DETAIL as diagnostic data and avoid copying it into a stable parser without accounting for values and formatting.
Representative case {#case}
The shared registry in verify/cases/44000/snippets.json (SHA-256 7b227bca904c860388c6cf1f5b7f551412b4d67832fb91aaa682f4126072e41c) creates a filtered view, attempts one row outside the predicate, and then inserts a valid row. See the public case export and structured evidence.
CREATE TABLE items(id integer PRIMARY KEY, visible boolean NOT NULL, note text NOT NULL);
CREATE VIEW visible_items AS SELECT id, visible, note FROM items WHERE visible WITH CHECK OPTION;
INSERT INTO visible_items VALUES (1, false, 'hidden');
INSERT INTO visible_items VALUES (1, true, 'visible');
SELECT id, visible, note FROM visible_items ORDER BY id;
The runner qualifies registry relation names inside a private schema. It asserts the natural server SQLSTATE and view diagnostic, then verifies that only the visible row was accepted.
The selected case observed 44000 on PostgreSQL 18.6 and 10.21 when a row with visible = false was inserted through a view with WITH CHECK OPTION. The DETAIL contained the failing row, autocommit stayed IDLE, and a row satisfying the predicate was accepted.
Versions {#versions}
The locked catalogue records this condition from the early historical boundary through the formal snapshots. The fixed source has the same mechanism in 18.6 and 10.23; the selected runtime case covers a simple insert through a view on 18.6 and 10.21, not every view-rule composition.
Related {#related}
Compare 23514 check violation for a table CHECK and 27000 triggered data change violation for trigger-driven same-command changes.
Sources {#sources}
src.errcodes.18.6(SHA-2566e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba)src.execMain.18.6(SHA-25633b97337fa23a649c5e7a092e1bd405a54e8503529236c62c9d5bb93a1774a8d)CREATE VIEW documentation· local call scansrc.calls.REL_18_6(SHA-2569ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf)
Compare versions
SQLSTATE evidence and recorded runtime versions
cases · view_check_option_recovery
{
"assertions": [
"SQLSTATE is 44000",
"The diagnostic identifies the view",
"The rejected row leaves autocommit usable",
"A row satisfying the view predicate is accepted"
],
"case_id": "view_check_option_recovery",
"cleanup": "Drop the case schema with an owner connection.",
"has_snippet": true,
"position": 0,
"preconditions": [
"A runner-owned disposable target is provisioned."
],
"repair": "Fix the row or the view predicate deliberately; do not bypass the view invariant by treating this as a table constraint failure.",
"trigger": "Insert a row through a view with a visible-row predicate and WITH CHECK OPTION, then insert a row satisfying the predicate.",
"versions": [
"10",
"18"
]
}claims · identity
{
"claim_id": "identity",
"limits": "This is a view write invariant, not a table CHECK constraint code.",
"method": "Read the fixed errcodes.txt row and macro mapping.",
"position": 0,
"runtime": [],
"sources": [
"src.errcodes.18.6"
],
"statement": "44000 is the with_check_option_violation condition in Class 44."
}claims · view-path
{
"claim_id": "view-path",
"limits": "The row representation and view name are dynamic.",
"method": "Trace ERRCODE_WITH_CHECK_OPTION_VIOLATION in execMain.c.",
"position": 1,
"runtime": [],
"sources": [
"src.execMain.18.6",
"src.calls.REL_18_6"
],
"statement": "ExecWithCheckOptions emits new row violates check option for view \"%s\" with a dynamic failing-row DETAIL."
}claims · three-valued-check
{
"claim_id": "three-valued-check",
"limits": "This describes the executor check; the selected case uses a directly updatable view.",
"method": "Read the fixed ExecWithCheckOptions comment and branch before the ERRCODE_WITH_CHECK_OPTION_VIOLATION report.",
"position": 2,
"runtime": [],
"sources": [
"src.execMain.18.6"
],
"statement": "ExecWithCheckOptions treats a view check qual that evaluates to NULL or FALSE as a violation because the new tuple would not be visible through the view."
}claims · detail-permission
{
"claim_id": "detail-permission",
"limits": "DETAIL may be absent even when the check ran.",
"method": "Trace the WCO_VIEW_CHECK permission guard before ExecBuildSlotValueDescription.",
"position": 3,
"runtime": [],
"sources": [
"src.execMain.18.6"
],
"statement": "The failing-row DETAIL for a view check option is conditional on permissions that allow the row description."
}claims · scope-and-trigger-boundary
{
"claim_id": "scope-and-trigger-boundary",
"limits": "The selected runtime case is a direct automatically updatable view; it does not exercise nested views, a trigger-updatable base, or an INSTEAD rewrite.",
"method": "Read the fixed CREATE VIEW documentation and compare the selected case definition.",
"position": 4,
"runtime": [],
"sources": [
"doc.create-view.18.6"
],
"statement": "LOCAL checks only conditions defined directly in the current view; ordinary underlying-view conditions are not checked unless those base views also specify CHECK OPTION. CASCADED checks the current view and all underlying base-view conditions. CHECK OPTION is supported only on automatically updatable views without an INSTEAD OF trigger or rule; a trigger-updatable base view stops a cascade, and an INSTEAD rule rewrite can cause all checks to be ignored."
}claims · repair
{
"claim_id": "repair",
"limits": "LOCAL/CASCADED view composition and UPDATE paths can add further predicates.",
"method": "Use the shared visible=true/false view case.",
"position": 5,
"runtime": [],
"sources": [
"doc.create-view.18.6"
],
"statement": "A write through a view with WITH CHECK OPTION must satisfy the view predicate; correcting the row preserves the invariant."
}claims · runtime
{
"claim_id": "runtime",
"limits": "This covers the selected directly updatable view path; it does not test nested LOCAL/CASCADED views or INSTEAD OF triggers.",
"method": "Read the selected runner summaries and raw outputs tied to the shared snippet registry.",
"position": 6,
"runtime": [],
"sources": [
"runtime.44000-batch34-20260909.latest",
"runtime.44000-batch34-20260909.pg10"
],
"statement": "The selected 44000 case passed on PostgreSQL 18.6 and 10.21 with the structured SQLSTATE, transaction-state, and repair assertions recorded in the runtime entries."
}messages · message.view-check
{
"limits": "Both the view identifier and row rendering are dynamic.",
"message_id": "message.view-check",
"path": "",
"position": 0,
"raw": {
"detail_template": "Failing row contains %s.",
"id": "message.view-check",
"limits": "Both the view identifier and row rendering are dynamic.",
"primary_template": "new row violates check option for view \"%s\"",
"severity_source": "ERROR",
"sources": [
"src.execMain.18.6"
],
"sqlstate": "44000"
},
"severity": "ERROR",
"sources": [
"src.execMain.18.6"
],
"templates": [
{
"kind": "primary",
"literal": "new row violates check option for view \" \"",
"position": 0,
"role": "",
"template": "new row violates check option for view \"%s\""
},
{
"kind": "detail",
"literal": "Failing row contains .",
"position": 1,
"role": "",
"template": "Failing row contains %s."
}
]
}runtimes · runtime.44000-batch34-20260909.latest · 18.6 (Homebrew) · passed
{
"cases": [
"view_check_option_recovery"
],
"limits": "",
"position": 0,
"raw": {
"case_manifest": {
"path": "verify/cases/44000/cases.json",
"sha256": "5512b051ff6459a4e3e6b5c35dcd1f30b1fff6f96d2513634382573954224f5a"
},
"cases": [
"view_check_option_recovery"
],
"id": "runtime.44000-batch34-20260909.latest",
"observed": {
"connection_autocommit": true,
"primary": "new row violates check option for view \"visible_items\"",
"repair": {
"rows": [
[
1,
true,
"visible"
]
]
},
"severity": "ERROR",
"sqlstate": "44000",
"statuses": {
"after_error": "IDLE",
"after_valid": "IDLE"
}
},
"raw": "verify/results/44000-batch34-20260909/latest/raw.jsonl",
"raw_sha256": "5b79b8c867bb95b70d22cff85bc3893ea16034731fb8a207c19b2910276efaa0",
"run_id": "44000-batch34-20260909",
"server_version": "18.6 (Homebrew)",
"snippet_registry": {
"path": "verify/cases/44000/snippets.json",
"sha256": "7b227bca904c860388c6cf1f5b7f551412b4d67832fb91aaa682f4126072e41c"
},
"status": "passed",
"summary": "verify/results/44000-batch34-20260909/latest/summary.json",
"summary_sha256": "3d674692d53f36522eb3c818be06c41fc9b4386bb7dd37e65f8410a88629162f",
"target": "latest"
},
"run_id": "44000-batch34-20260909",
"runtime_id": "runtime.44000-batch34-20260909.latest",
"server_version": "18.6 (Homebrew)",
"status": "passed",
"target": "latest"
}runtimes · runtime.44000-batch34-20260909.pg10 · 10.21 (Debian 10.21-1.pgdg90+1) · passed
{
"cases": [
"view_check_option_recovery"
],
"limits": "",
"position": 1,
"raw": {
"case_manifest": {
"path": "verify/cases/44000/cases.json",
"sha256": "5512b051ff6459a4e3e6b5c35dcd1f30b1fff6f96d2513634382573954224f5a"
},
"cases": [
"view_check_option_recovery"
],
"id": "runtime.44000-batch34-20260909.pg10",
"observed": {
"connection_autocommit": true,
"primary": "new row violates check option for view \"visible_items\"",
"repair": {
"rows": [
[
1,
true,
"visible"
]
]
},
"severity": "ERROR",
"sqlstate": "44000",
"statuses": {
"after_error": "IDLE",
"after_valid": "IDLE"
}
},
"raw": "verify/results/44000-batch34-20260909/pg10/raw.jsonl",
"raw_sha256": "baf0278700f3e0f15b3b12de0f97bdf31173c6e9470a12b198ee7e696568998a",
"run_id": "44000-batch34-20260909",
"server_version": "10.21 (Debian 10.21-1.pgdg90+1)",
"snippet_registry": {
"path": "verify/cases/44000/snippets.json",
"sha256": "7b227bca904c860388c6cf1f5b7f551412b4d67832fb91aaa682f4126072e41c"
},
"status": "passed",
"summary": "verify/results/44000-batch34-20260909/pg10/summary.json",
"summary_sha256": "24148b05266cf9fe1cda71058dd89ac856f1c4020c886b3a5ab33a51186377e8",
"target": "pg10"
},
"run_id": "44000-batch34-20260909",
"runtime_id": "runtime.44000-batch34-20260909.pg10",
"server_version": "10.21 (Debian 10.21-1.pgdg90+1)",
"status": "passed",
"target": "pg10"
}sources · src.errcodes.18.6
{
"commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
"docs_url": "",
"kind": "upstream_source",
"location": "",
"path": "src/backend/utils/errcodes.txt",
"position": 0,
"sha256": "6e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba",
"source_id": "src.errcodes.18.6",
"tag": "REL_18_6",
"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/errcodes.txt"
}sources · src.calls.REL_18_6
{
"commit": "",
"docs_url": "",
"kind": "local_artifact",
"location": "",
"path": "raw/calls/REL_18_6.jsonl",
"position": 1,
"sha256": "9ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf",
"source_id": "src.calls.REL_18_6",
"tag": "",
"url": ""
}sources · src.execMain.18.6
{
"commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
"docs_url": "",
"kind": "upstream_source",
"location": "",
"path": "src/backend/executor/execMain.c",
"position": 2,
"sha256": "33b97337fa23a649c5e7a092e1bd405a54e8503529236c62c9d5bb93a1774a8d",
"source_id": "src.execMain.18.6",
"tag": "REL_18_6",
"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/executor/execMain.c#L2322-L2327"
}sources · src.execMain.10.23
{
"commit": "02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4",
"docs_url": "",
"kind": "upstream_source",
"location": "",
"path": "src/backend/executor/execMain.c",
"position": 3,
"sha256": "386d09f7e964ebc426a554cf51ac7cb505c67cc95b971ee7acad1a6e0a9d0c1a",
"source_id": "src.execMain.10.23",
"tag": "REL_10_23",
"url": "https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/src/backend/executor/execMain.c#L2178-L2183"
}sources · doc.create-view.18.6
{
"commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
"docs_url": "https://www.postgresql.org/docs/18/sql-createview.html",
"kind": "upstream_source",
"location": "",
"path": "doc/src/sgml/ref/create_view.sgml",
"position": 4,
"sha256": "d2c2aae6e102594deaa2f5aabc7910cdaada11d714e49e818511a57bb21fec57",
"source_id": "doc.create-view.18.6",
"tag": "REL_18_6",
"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/doc/src/sgml/ref/create_view.sgml"
}Source references
Full definition and evidence JSON
Definition sources
center · PostgreSQL 18 · english-manuals:8d310609fce53b96cf483736a9fffa6ccb8c07ade69cb1c0bf23ae25b64bb342
Text language: en · english-manuals:8d310609fce53b96cf483736a9fffa6ccb8c07ade69cb1c0bf23ae25b64bb342