Skip to content

Update to lib_pb_query 6.2.2#16

Merged
magnetised merged 10 commits intomainfrom
magnetised/update-lib_pg_query
Mar 11, 2026
Merged

Update to lib_pb_query 6.2.2#16
magnetised merged 10 commits intomainfrom
magnetised/update-lib_pg_query

Conversation

@magnetised
Copy link
Collaborator

@magnetised magnetised commented Mar 9, 2026

Also adds a couple of validation steps:

  • guard against large queries to prevent a segfault trying to allocate more memory than is available on the stack
  • guard against null values in the protobuf ast passed to deparse.

And adds fuzzing to the library. This found a single problem, which was caused by NULLs in the AST passed to deparse.

7be1aed Release 17-6.2.2 (#326)
a09b7bc pg_query_deparse_comments_for_query: Add missing initialization (#324)
7eee7a6 pg_query_normalize: Fix handling of special strings in DefElem (#325)
b2217bf Merge pull request #322 from pganalyze/release-17-6-2-1
300dc98 Apply suggestions from code review
443c1c1 Release 17-6.2.1
1915589 Add `pg_query_is_utility_stmt()` (#313)
693209e Run pgindent on pg_query_summary.c
5e3e4a7 Summary: Correctly handle schema qualfied filter columns
d9867f6 Summary: Correctly handle "GRANT .. ON ALL TABLES IN SCHEMA" statemnets
426f56f Speed up summary truncate replacement logic (#319)
180ef56 Add missing top-level postgres_deparse.h in Makefile install step (#318)
a192b38 Release 17-6.2.0 (#314)
6c04919 Update to Postgres 17.7 (#315)
3f1b676 Add test framework support for running individual tests. (#310)
03e2f43 Fix compilation warnings for the examples in README.md (#312)
64ace44 Add summary support for MERGE statements  (#311)
581c9ac Add summary support for functions invoked via CALL (#309)
bb1f456 Add truncation support to `pg_query_summary()` (#300)
cd20bb8 Fix deparse of ALTER TABLE a ALTER b SET STATISTICS DEFAULT (#303)
32dfcf8 Add pg_query_parse_summary() and supporting code (#274)
9ac12d2 Deparser: Introduce pretty printing / formatting
1d80fc4 Fix bug in handle of MultiAssignRef nodes that follow a single column
be38617 Add missing trailing space after LockingClause relation names
8d3336d Deparser: Rework handling of expressions inside typecasts
ea8822a Use lowercase keywords in xmlroot functions
82b52b2 Deparser: Introduce dedicated state structure to replace StringInfo
c863655 Bump Postgres to 17.5 and switch back to release tarballs
dabe930 Add support for CALL statements
699f2b1 Update GitHub Actions Linux OS to 24.04 (#289)
8fbb9cc Allow alternate definitions of NAMEDATALEN identifier limit (#268)

git-subtree-dir: c_src/libpg_query
git-subtree-split: 7be1aed1f1f968a36cf541319f71e845850f0381
@magnetised magnetised force-pushed the magnetised/update-lib_pg_query branch from 5926278 to 7c9a610 Compare March 9, 2026 12:22
@magnetised magnetised force-pushed the magnetised/update-lib_pg_query branch 3 times, most recently from 1f12627 to 0182a83 Compare March 11, 2026 10:50
@magnetised magnetised force-pushed the magnetised/update-lib_pg_query branch from 0182a83 to 83529c0 Compare March 11, 2026 11:35
@magnetised magnetised force-pushed the magnetised/update-lib_pg_query branch from 6d3e629 to a862a21 Compare March 11, 2026 13:55
@magnetised magnetised force-pushed the magnetised/update-lib_pg_query branch from a862a21 to 6a95fb5 Compare March 11, 2026 13:57
Copy link
Member

@alco alco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does lib_pb_query in the title refer to https://github.com/pganalyze/libpg_query? Would it be prudent for us to include it as a submodule as opposed to maintaining a vendored source code tree? It's more difficult to keep track of which version it's on this way.

fuzz-corpus: fuzz/_build/gen_deparse_corpus
@mkdir -p fuzz/corpus/deparse
fuzz/_build/gen_deparse_corpus fuzz/corpus/deparse \
"SELECT 1" \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this autogenerated from fuzz/corpus/parse? Is there a script to regenerate the Makefile after we update the corpus?

Would be useful to have this meta documented for posterity.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's just inline, not autogenerated.

@magnetised
Copy link
Collaborator Author

Does lib_pb_query in the title refer to pganalyze/libpg_query? Would it be prudent for us to include it as a submodule as opposed to maintaining a vendored source code tree? It's more difficult to keep track of which version it's on this way.

It's included as a git subtree not a submodule. so kind of tracked-vendored

@magnetised magnetised merged commit b6c869d into main Mar 11, 2026
1 check passed
@magnetised magnetised deleted the magnetised/update-lib_pg_query branch March 11, 2026 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants