-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade to PSQL 15.1 #167
Upgrade to PSQL 15.1 #167
Conversation
Wow! |
Why |
FYI, I almost completed upgrading pglast to this, and everything seems working great! 🎉 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall!
For the fingerprint tests, can we also add one for MERGE that contains a constant value? Something like this:
MERGE INTO customer_account ca
USING (VALUES (1, 42), (2, 99)) t(customer_id, transaction_value)
ON t.customer_id = ca.customer_id
WHEN MATCHED THEN
UPDATE SET balance = balance + transaction_value + 1
WHEN NOT MATCHED THEN
INSERT (customer_id, balance)
VALUES (t.customer_id, t.transaction_value);
This upgrades `libpg_query` to Postgres 15.1. All tests have been updated, and tests were added for new constructs. - `Boolean` nodes have been added to the parser, replacing usage of integers with the values `1`/`0`. - In the postgres parser, `Value` was changed to be a union stored in the `A_Const` type. For this upgrade, we block `A_Const` from code generation, and instead manually implement the relevant required functions. - The `COPY` statement deparser was also updated to attempt deparsing into the old Postgres 8.4-style syntax (e.g. `COPY foo FROM STDIN FREEZE CSV`). This ensures that the regression tests keep working, as new changes in the parse structures mean that these two syntaxes result in equivalent but slightly different parse trees. - Support was added for `MERGE` statements. - Support was added for more advanced publication objects, e.g. `CREATE PUBLICATION foo FOR TABLES IN SCHEMA CURRENT_SCHEMA` - Support was added for `ALTER TABLE ALL IN TABLESPACE ...` statements
This follows the C++ protobuf implementation of JSON generation for consistency.
901ad3a
to
a1fd904
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Nicely done, and thanks for adding that extra fingerprint test!
Before merging it would be good to pull in the latest changes from 14-latest (really that should just be #168 which is now merged) - otherwise I think this is good to ship 🚢
This upgrades
libpg_query
to Postgres 15.1. All tests have been updated, and tests were added for new constructs.Boolean
nodes have been added to the parser, replacing usage of integers with the values1
/0
.Value
was changed to be a union stored in theA_Const
type. For this upgrade, we blockA_Const
from code generation, and instead manually implement the relevant required functions.COPY
statement deparser was also updated to attempt deparsing into the old Postgres 8.4-style syntax (e.g.COPY foo FROM STDIN FREEZE CSV
). This ensures that the regression tests keep working, as new changes in the parse structures mean that these two syntaxes result in equivalent but slightly different parse trees.MERGE
statements.CREATE PUBLICATION foo FOR TABLES IN SCHEMA CURRENT_SCHEMA
ALTER TABLE ALL IN TABLESPACE ...
statements