Releases: pganalyze/libpg_query
Releases · pganalyze/libpg_query
13-2.0.3
- Normalize: Fix handling of two subsequent DefElem elements #96
- We were incorrectly adding too many DefElem locations to the recorded
constant values, causing a crash when more than a single DefElem
is present in a utility statement.
- We were incorrectly adding too many DefElem locations to the recorded
$ shasum -a 256 libpg_query-13-2.0.3.*
7f2b74e1fcc7322e7565fd7465d85db3fb453e9cb7f2edba7e5ea7ab63d27dfe libpg_query-13-2.0.3.tar.gz
49fe7bbc0c727ff7b2e0ac2aecaf2863a1ca61543701986a71d7a0c24daf825b libpg_query-13-2.0.3.zip
Release 13-2.0.2
- srcdata/nodetypes.json: Avoid bogus values accidentally parsed from inside comments
$ shasum -a 256 libpg_query-13-2.0.2.*
fe485f48bb51dcc5ed146b1c9929da417357ae8844c2f0c8fe1e235fa1d14257 libpg_query-13-2.0.2.tar.gz
160b3bf55e94a3bb06825fdd20019e53d21380824f13ca9f7b97adf842b0978e libpg_query-13-2.0.2.zip
13-2.0.1
- Fix ARM builds: Avoid dependency on cpuid.h header
- Simplify deparser of TableLikeClause #91 Lele Gaifax
- Fix asprintf warnings by ensuring _GNU_SOURCE is set early enough
$ shasum -a 256 libpg_query-13-2.0.1.*
e459db08c551ca11f008c3b8bc7add247781daed0043bd940c82de52331b5c72 libpg_query-13-2.0.1.tar.gz
7bee0b010bf9b60e8f49c15b7fe55cf2569ef6d5afc0cf37808e7be11768a398 libpg_query-13-2.0.1.zip
13-2.0.0
- Update to PostgreSQL 13 parser (13.2 release)
- Changes to JSON output format
- WARNING: These JSON format changes are incompatible with prior releases.
- New top-level result object that contains the Postgres version number the
parser is based on - Node type names are only output when the field is a generic field (Node*),
but not when the field always has the same type. This matches how the
Postgres source looks like, and ensures the JSON and (new) Protobuf format
match in their structure. You can utilize thesrcdata/struct_defs.json
file as needed to get the necessary context on field types. - Whitespace between control characters in JSON is no longer added
- "<" and ">" characters are escaped to avoid browser HTML injections
- Enum values are output with the value's name, instead of the integer value
- Introduce new Protobuf parse tree output format
- Up until now, this library relied on JSON to pass the parse result back
to the caller, which has a number of downsides, most importantly that
we don't have a readily available parser for JSON thats not tied to a
running Postgres server. That in turn makes it hard to provide
cross-language features such as deparsing directly in this library
(which would require reading back a parse tree that gets passed in). - Protobuf isn't perfect, but its straightforward enough to generate the
schema definitions for the parse tree nodes, and output the tree using
a bundled C protobuf library, which has a small enough SLOC count (~3k)
to not be noticeable in the big picture.
- Up until now, this library relied on JSON to pass the parse result back
- Add support for returning Postgres scanner result
- This allows utilizing pg_query for use cases that need the raw token
information, instead of a parse tree. Due to additional modifications
to the Postgres source, this also contains information about comments
in the query string, and their location.
- This allows utilizing pg_query for use cases that need the raw token
- Add deparsing functionality that turns parse tree back into a SQL query
- This is based on the deparser that was written over multiple years for
the pg_query Ruby library, and is now accessible for all bindings through
this new API and implementation.
- This is based on the deparser that was written over multiple years for
- Fingerprinting: Introduce v3 version and 64-bit XXH3 hash
- See full details in the wiki page here: https://github.com/lfittl/libpg_query/wiki/Fingerprinting#version-30-based-on-postgresql-13
- Add new pg_query_split_with_scanner/pg_query_split_with_parser functions to
split up multi-statement strings- Naively one could assume that splitting a string by ";" is sufficient,
but it becomes tricky once one takes into consideration that this
character can also show up in identifier, constants or comments. - We provide both a parser-based split function and a scanner-based split
function. Most importantly when splitting statements in a file that may
contain syntax errors that cause a parser error, but are accepted by the
scanner. Otherwise the parser-based split function is recommended
due to better accuracy.
- Naively one could assume that splitting a string by ";" is sufficient,
- Add experimental Protobuf C++ outfuncs, converge JSON output to match Protobuf
mapped output - Extract source with USE_ASSERT_CHECKING enabled
- This ensures we have the necessary functions to compile an
assert-enabled build if necessary. Note that this doesn't mean that
asserts are enabled by default (they are not, you need to explicitly
use DEBUG=1).
- This ensures we have the necessary functions to compile an
- Ensure codebase has a clean Valgrind run
- PL/pgSQL: Output NEW/OLD variable numbers, record dno fields Ethan Resnick
- Makefile: Allow passing in customized CFLAGS/PG_CONFIGURE_FLAGS/TEST_* Ethan Resnick
$ shasum -a 256 libpg_query-13-2.0.0.*
e5e6514b1ae0e1ab19a2441de3088988bf1b89778164f9c725c3d85c6903133e libpg_query-13-2.0.0.tar.gz
066680c284bd82c2922562efc57bfbf848708785abd4d87798f0ceca72942888 libpg_query-13-2.0.0.zip
10-1.0.5
- Update to latest Postgres 10 patch release (10.16)
- Free Postgres top-level memory context on thread exit / with function
- Previously there was no way to free the top-level Postgres memory context,
causing threaded programs that churn through a lot of threads to leak
memory with each newly initialized thread-local top-level memory context. - Instead, this uses a newly introduced cleanup method to free the memory
when a pthread exits (note this causes a pthread dependency to be added
to this library). In addition, primarily for memory testing purposes, add a
new method "pg_query_exit" that performs the same cleanup on demand.
- Previously there was no way to free the top-level Postgres memory context,
- Resolve correctness issues and possible memory leak in PL/pgSQL parser
- Add arch-ppc.h for PPC architectures #80 @pkubaj
$ shasum -a 256 libpg_query-10-1.0.5.*
b96ac0d09eecde3cfd2bb5cb0e7a251aab2ae9a2fe8be54ce83c973f20b6cb12 libpg_query-10-1.0.5.tar.gz
71acb837308d316366b17a820b0dca31137afd474c5a80e14d1ff7c9f673da12 libpg_query-10-1.0.5.zip
10-1.0.4
- Update to latest Postgres 10 patch release (10.15)
- PL/pgSQL parsing: Handle asprintf failures (and prevent compiler warning)
$ shasum -a 256 libpg_query-10-1.0.4.*
88cc90296e5fcaaebd0b360c46698b7c5badddf86f120e249ef682a820d41338 libpg_query-10-1.0.4.tar.gz
91e5146fc3c17f9897f40af62a1b2fd45039f28ddfa3a563ad3aa1e371471b27 libpg_query-10-1.0.4.zip
10-1.0.3
- Update to latest Postgres 10 patch release (10.14)
- Add support for ARM builds by explicitly copying ARM header file
- Ignore return value of asprintf without compiler warnings @herwinw
- Free stderr_buffer when parsing plpgsql @herwinw
$ shasum -a 256 libpg_query-10-1.0.3.*
1332761f31c198cb9825e6ccccda0b6a0e57daeb824870e8524df77f1592d149 libpg_query-10-1.0.3.tar.gz
6f2eb5d7b2d59d0298f269910e3b8cfa621ce446cc650ab57aa1a39169f23d5a libpg_query-10-1.0.3.zip
9.5-1.4.2
9.5-1.4.1
9.5-1.4.0
- Clean up includes to avoid dependency on stdbool.h and xlocale.h
- Change PL/pgSQL input to be the full CREATE FUNCTION statement
- This is necessary for parsing, since we need the argument and return types
- Fingerprinting Version 1.1
- Only ignore ResTarget.name when parent field name is targetList and
we have a SelectStmt as a parent node (fixes UpdateStmt fingerprinting)
- Only ignore ResTarget.name when parent field name is targetList and
- Normalize the password in ALTER ROLE ... PASSWORD '123' statements
- Make library thread-safe through thread-local storage #13