You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Npgsql 11 writes JSON setters through jsonb_set_lax: the value set refusal names the column instead of the path, and a reason that no longer applies #289
Npgsql EF 11 writes an ExecuteUpdate setter inside a jsonb document as jsonb_set_lax(doc, path, value) on PostgreSQL 16 and later whenever the value may be null, and coalesces to JSON null below 16. ValueSetSqlGuard only knew jsonb_set/json_set, so on EF Core 11 the refusal lost the path ('Doc' instead of 'Doc.MaybeTags'; ExecuteUpdateGuardTests and ExecuteUpdateJsonTests fail). The null half of its message is also wrong there: measured on PostgreSQL 16 with the refusal disabled, a value that may be null (to_jsonb(CASE … THEN NULL ELSE @p END)) now sets the property to JSON null for the null outcome, as SaveChanges does, where jsonb_set returned NULL for the whole document; a null constant or parameter still fails on the server with 42804 (to_jsonb(NULL) is untyped). Only the JSON array is left to refuse.
Change
Match jsonb_set_lax too; drop the "writes NULL as the whole document" reason and the MayBeNull distinction; the null refusal names 42804. docs/efcore.md's JSON-column table says the same. Still refused in every case it was.
The 10.x line has this too, behind a configuration knob. Npgsql EF 10.0.3 carries npgsql/efcore.pg#3855 (the jsonb_set_lax name is in its assembly, and in none of 10.0.0–10.0.2); the translator uses it when the configured PostgreSQL version is 16 or later and the value may be null, and Npgsql EF 10's default assumed version is 14 (NpgsqlOptionsExtension.DefaultPostgresVersion). Measured 2026-10-19 on release/10.x with the test host on EF Core 10.0.13 / Npgsql EF 10.0.3: with UpdateTestContext unchanged all 7 ExecuteUpdateGuardTests pass; with .SetPostgresVersion(16, 0) added, 6 of 7 fail on the path in the message ('Doc' for 'Doc.Tags'), every refusal still firing. Filed as #303 under the 10.0.1 epic (#296), severity/low.
For #294's record: backported to Npgsql EF 10.0.3, reaches a 10.x consumer only through SetPostgresVersion(16, 0) or higher, which the documented PostgreSQL 16 floor invites.
Activity
CaffeinatedCoder commentedon Oct 19, 2026
The 10.x line has this too, behind a configuration knob. Npgsql EF 10.0.3 carries npgsql/efcore.pg#3855 (the
jsonb_set_laxname is in its assembly, and in none of 10.0.0–10.0.2); the translator uses it when the configured PostgreSQL version is 16 or later and the value may be null, and Npgsql EF 10's default assumed version is 14 (NpgsqlOptionsExtension.DefaultPostgresVersion). Measured 2026-10-19 onrelease/10.xwith the test host on EF Core 10.0.13 / Npgsql EF 10.0.3: withUpdateTestContextunchanged all 7ExecuteUpdateGuardTestspass; with.SetPostgresVersion(16, 0)added, 6 of 7 fail on the path in the message ('Doc'for'Doc.Tags'), every refusal still firing. Filed as #303 under the 10.0.1 epic (#296), severity/low.For #294's record: backported to Npgsql EF 10.0.3, reaches a 10.x consumer only through
SetPostgresVersion(16, 0)or higher, which the documented PostgreSQL 16 floor invites.