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
PG17 introduced support for the standardized SQL/JSON functions, specifically JSON_VALUE() and JSON_QUERY() - we should consider switching to those when the compatibility mode is set to PG17. One notable advantage is that e.g. JSON_VALUE() allows specifying the return type; we currently use the -> operator and wrap the result in a cast, which may be less efficient and also doesn't support JSON-specific conversions (for example, getting a binary out of JSON is likely to do base64 decoding automatically, without us having to manually take care of it).
Another possibility is to switch from jsonb_to_recordset to the new JSON_TABLE().
The text was updated successfully, but these errors were encountered:
SQL Server will be introducing support for the same RETURNING clause (which is part of the ANSI SQL standard), the EF-side tracking issue is dotnet/efcore#35729. Implement this in EF's relational layer, to support both SQL Server and PG at the same time.
roji
changed the title
Switch to the new SQL/JSON PG17 JSON functions
Switch to the new SQL/JSON PG17 JSON_VALUE/JSON_QUERY functions
Mar 6, 2025
roji
added a commit
to roji/efcore.pg
that referenced
this issue
Mar 6, 2025
PG17 introduced support for the standardized SQL/JSON functions, specifically JSON_VALUE() and JSON_QUERY() - we should consider switching to those when the compatibility mode is set to PG17. One notable advantage is that e.g. JSON_VALUE() allows specifying the return type; we currently use the
->
operator and wrap the result in a cast, which may be less efficient and also doesn't support JSON-specific conversions (for example, getting a binary out of JSON is likely to do base64 decoding automatically, without us having to manually take care of it).Another possibility is to switch from jsonb_to_recordset to the new JSON_TABLE().
The text was updated successfully, but these errors were encountered: