Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
roji opened this issue Sep 28, 2024 · 0 comments
Open

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

roji opened this issue Sep 28, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@roji
Copy link
Member

roji commented Sep 28, 2024

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

@roji roji added the enhancement New feature or request label Sep 28, 2024
@roji roji added this to the 9.0.0 milestone Sep 28, 2024
@roji roji self-assigned this Sep 28, 2024
@roji roji modified the milestones: 9.0.0, Backlog, 10.0.0 Oct 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant