Repository navigation
PGSQL 17/18 prohibits function json() but allows "json"() - #22
Open
andreimerlescu wants to merge 1 commit into
Open
andreimerlescu wants to merge 1 commit into
andreimerlescu wants to merge 1 commit into
Conversation
Signed-off-by: Andrei Merlescu <andrei+github@merlescu.net>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
Graphicle can't create a PostgreSQL store on PostgreSQL 17 or newer:
functions.sqlusesjsonas a name in three places: the functionjson(doc text), and thejsoncolumn bothjson_eachfunctions return.Since PostgreSQL 17,
JSONis a keyword that can't name a function,parameter or returned column unquoted (Appendix C).
On 16 it could, so 16 works. Ubuntu 26.04 ships 18.
This quotes all three (
"json"). The names are unchanged, so queries thatread the column don't change. No other name in the file collides with a
keyword of PostgreSQL 18.
CI doesn't set
GRAPHICLE_DATABASE_URL, so the PostgreSQL tests areskipped there. A follow-up could add a PostgreSQL 16 and 18 service job.
How you tested it
GRAPHICLE_DATABASE_URLset:cargo test --locked --test it postgres_store: 8 of 8 pass; 6 of 8 failwith the error above without the
json_eachpart of the fix.functions.sqlloads, andjson_eachand
"json"()return what they did before.I ran a benchmark against a host with 12 GiB of RAM on 2.2GHz CPUs that performed at:
Checklist
git commit -s), as theDeveloper Certificate of Origin asks
(CONTRIBUTING.md).
say "PostgreSQL 16 or newer"; the existing PostgreSQL tests cover it.)
Cargo.lockchanged, I rancargo deny checkin that crate andrefreshed its licence page, as CONTRIBUTING.md describes. (No change.)
credited in the crate's
NOTICE.md. (None.)evidence in
docs/benchmarks.md. (None.)