Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 38 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,43 @@

* ...

## 6.2.1 2026-01-20

* Upgrade to libpg_query 17-6.2.1
- Add pg_query_is_utility_stmt function to determine if query text contains utility statements [#313](https://github.com/pganalyze/libpg_query/pull/313)
- This is a fast check for callers that don't actually need the parse tree itself
- Add fast summary information function (pg_query_summary)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Note that the Ruby bindings for pg_query_summary and pg_query_is_utility_stmt are still missing, so it's not really correct to include these in the changelog

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ah good point (also re: pganalyze/pg_query_go#145 (comment)).
If we removed #344 (comment), I guess we should also have removed them 🤔

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yeah, that's fair, we can amend the changelog to clarify this.

- This allows gathering certain information, for example which tables are referenced in a
statement, without requiring a Protobuf serialization step in a higher level library
- Additionally this can also be used to perform "smart truncation" of a query by
omitting deeply nested information (e.g. a CTE definition, or a target list) whilst
preserving more essential parts like the FROM clause
- Deparser:
- Introduce pretty printing / formatting
- Introduces a new optional pretty print mode that emits a human readable
output. A detailed explanation of the mechanism can be found at the start
of the deparser file.
- Rework handling of expressions inside typecasts
- Prefer (..)::type syntax, unless we are already in a function call.
- Use lowercase keywords in xmlroot functions
- This matches other XML functions as well as the Postgres documentation,
since these are closer to function argument names than regular keywords.
- Fix deparse of ALTER TABLE a ALTER b SET STATISTICS DEFAULT
- Fix the null pointer dereference when handling identity columns
- Allow alternate definitions of NAMEDATALEN identifier limit
- This allows building libpg_query with an override of the built-time limit of
Postgres identifiers (typically 63 characters)
- Normalization: Add support for CALL statements
- Bump Postgres to 17.7 and switch back to release tarballs
* Deparser: Support pretty-printing and other deparser options
- `PgQuery::ParserResult#deparse` now takes options like `pretty_print`
* Add `PgQuery.split_with_parser` method to allow splitting statements
* Support Ruby 4.0+ development versions for extension building
* Fix ABI version error with TruffleRuby on Mac
* Support finding functions invoked with CALL
* Support null_test and boolean_test node type with parsing
* Expose `PgQuery::ParserResult#find_tree_location` method

## 6.1.0 2025-04-02

* Upgrade to libpg_query 17-6.1.0
Expand Down Expand Up @@ -174,7 +211,7 @@

* Update to libpg_query 13-2.0.6
- Update to Postgres 13.3 patch release
- Normalize: Don't touch "GROUP BY 1" and "ORDER BY 1" expressions, keep original text
- Normalize: Don't touch "GROUP BY 1" and "ORDER BY 1" expressions, keep original text
- Fingerprint: Cache list item hashes to fingerprint complex queries faster
- Deparser: Emit the RangeVar catalogname if present
- Fix crash in pg_scan function when encountering backslash escapes
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
pg_query (6.1.0)
pg_query (6.2.1)
google-protobuf (>= 3.25.3)

GEM
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,11 @@ not correctly handle all CTEs, or rewrite columns with explicit table names.

Currently tested and officially supported Ruby versions:

* CRuby 2.7
* CRuby 3.0
* CRuby 3.1
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

3.0 and 3.1 is EOL, maybe in the next release, we can retire them and support 4

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think technically 4.0 is supported now, but its not running in CI.

* CRuby 3.2
* CRuby 3.3
* CRuby 3.4

Not supported:

Expand Down
2 changes: 1 addition & 1 deletion lib/pg_query/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module PgQuery
VERSION = '6.1.0'.freeze
VERSION = '6.2.1'.freeze
end