Repository navigation
Advance the pin to libpg_query 18.1.0 (PostgreSQL 18.6) - #14
Merged
Merged
Conversation
Moves the oracle and the reference grammar to libpg_query 18.1.0 and regenerates every golden from it. Ports the behavior changes: - Lexer: comments are whitespace to the grammar unless returnComments is set (only Scan sets it); "--" comments may sit between continued string literals. - Parser: DefElem.arg_location, NotifyStmt.payload_location and Create/AlterSubscriptionStmt.conninfo_location; LANGUAGE split into NonReservedWord and Sconst forms. - Normalize: constant locations come from the parser, with an overlap check; NOTIFY payloads are normalized. - Fingerprint: new skip fields (location fields, NOTIFY payload, role names), TransactionStmt options included, depth cutoff for specific node fields. - Deparse: operator-precedence based parenthesization (#371). - Summary: CTE self-reference handling (#367). - PL/pgSQL: errors for a DO or function with no body (#363). - Oracle build script: upb instead of protobuf-c, scan tokens header, testdata now from pg_query_go. Regenerate accepts the NULL sentinel in parse_tests.c. Version is now 180006. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LuRZ4KpRYD6ucjb97ykMZQ
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.
Requested by Kyle · project thread
Summary
The request was Postgres 19. PostgreSQL 19.0 is out, but pganalyze/libpg_query has no 19 release, branch or PR yet, and our goldens can only come from the pinned libpg_query oracle. So this PR moves the pin to the newest release, libpg_query 18.1.0 (PostgreSQL 18.6). The 19 upgrade can follow once libpg_query ships it.
ParseResult.Versionis now180006. Every golden inparser/testdatawas regenerated withcmd/regenerateagainst the 18.1.0 oracle. None were edited by hand, and two regenerate runs produced byte-identical output.What changed upstream and how it was ported
return_commentsis set, which onlypg_query_scandoes. Before,NOT /* c */ INdid not merge toNOT_LA; now it does. A--comment between continued string literals is now allowed.Scanuses the newlexer.NewReturningComments.DefElem.arg_location,NotifyStmt.payload_location, andCreateSubscriptionStmt/AlterSubscriptionStmt.conninfo_location.makeDefElemdefaultsarg_locationto -1. TheLANGUAGErule is split into NonReservedWord and Sconst forms.TransactionStmt.optionsis now included. A specific node field is cut off at the depth limit.internal/deparse/precedence.go.DOand plpgsql functions with no body now error, matching #363.oracle/update-pg-query-go.shcopies upb instead of protobuf-c, pluspg_query_scan_tokens.h, and falls back to pg_query_go's testdata now that libpg_query droppedtestdata/fingerprint.json.cmd/regenerateaccepts theNULLsentinel that now endsparse_tests.c.internal/referencewas re-vendored from PG 18.6 with patches 01, 03, 04, 09, 14 and 15.srcdatais from the 18.1.0 tag. Generated files were rebuilt withcmd/generate. The docs (README, PLAN.md, CLAUDE.md, the regenerate workflow) now name the new pin.Not ported
ALTER SUBSCRIPTION s CONNECTION ''crashes the C deparser. oliphant returns a result here, so this one case can't be matched.Testing
go test ./...passes, andgo test ./parser -run TestCorpus -check-parseshows 0 todo cases in every suite.gofmtandgo vetare clean.Generated by Claude Code