Skip to content

Switch to the new SQL/JSON PG17 JSON_VALUE/JSON_QUERY functions #3304

@roji

Description

@roji

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().

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions