Skip to content

Conversation

@asacalow
Copy link

Replaced the libpg_query subtree with 17-latest, rebuilt the protobuf bindings and bumped the version number in the test so all tests pass.

wolfgangwalther and others added 30 commits September 6, 2022 23:30
This was removed in postgres/postgres@a676386.

Signed-off-by: Wolfgang Walther <[email protected]>
This was added in postgres/postgres@40c24bf, but should actually not be present in the raw parser output.

Signed-off-by: Wolfgang Walther <[email protected]>
This was added in postgres/postgres@c9d5298, but should actually not be present in the raw parser output.

Signed-off-by: Wolfgang Walther <[email protected]>
This was added in postgres/postgres@45b9805 and should render as CURRENT_ROLE.

Signed-off-by: Wolfgang Walther <[email protected]>
This was added in postgres/postgres@bbe0a81 and later changed in postgres/postgres@e6241d8.

Signed-off-by: Wolfgang Walther <[email protected]>
This was added in postgres/postgres@a4d75c8, but should actually not be present in the raw parser output.

Signed-off-by: Wolfgang Walther <[email protected]>
…ROP_PUBLICATION to deparser

Those were added in postgres/postgres@82ed774.

The same commit also changed ALTER_SUBSCRIPTION_PUBLICATION to ALTER_SUBSCRIPTION_SET_PUBLICATION.

Signed-off-by: Wolfgang Walther <[email protected]>
Signed-off-by: Wolfgang Walther <[email protected]>
Signed-off-by: Wolfgang Walther <[email protected]>
Signed-off-by: Wolfgang Walther <[email protected]>
Signed-off-by: Wolfgang Walther <[email protected]>
msepga and others added 26 commits October 30, 2024 21:41
* Fix cursor quoting in FetchStmt

Regression tests updated to test all cursor related statement with a name that
requires quoting.

* Test quoting in `deparse_tests.c`

---------

Co-authored-by: msepga <[email protected]>
We've removed them in previous refactorings, but didn't clean up the list.
This called the general deparseExpr function (a_expr), but should
actually have called the deparseCExpr function (since AexprConst is
part of c_expr). However we currently do not handle TypeCast nodes inside
deparseCExpr, causing it to add parenthesis unnecessary. To mitigate,
add a dedicated function for this.
This allows us to handle keyword-style FuncCalls correctly in
deparseFuncCall, as will be done in a subsequent commit.

Note that the safe choice here is to set the context to NONE, which
intends to add parenthesis in places where a_expr is not allowed
(b_expr or c_expr can be turned into an a_expr by being wrapped in parens)
This fixes a correctness issue where the deparsed SQL is not parsable,
since the table DEFAULT expression is a b_expr, not an a_expr.
Note that the deparseAExpr function (used for deparsing A_Expr nodes)
can be called from both a_expr and b_expr contexts, but we previously
always passed NONE as the context.

Besides now passing down the context, the function also used to add
outer parenthesis to AEXPR_OP calls. This appears unnecessary (b_expr
allows operator expressions without wrapping parenthesis) and was not
utilized in practice, so remove that to avoid extra parenthesis.
This pulls in the strchrnul compatibility patch directly from upstream,
instead of applying it manually. Other updates since 17.0 are minor and
should not affect parser behaviour.
This unintentionally got removed when re-running the extract_source
logic on macOS 15.4, which no longer requires LOCALE_T_IN_XLOCALE to
be set.
This makes it clear which parts of the repository are under the Postgres
license.
…657fc1753'

git-subtree-dir: c_src/libpg_query
git-subtree-mainline: fb3cdc6
git-subtree-split: d00c096
@asacalow asacalow mentioned this pull request Apr 22, 2025
@icehaunter
Copy link
Contributor

Thanks, we were about to do it ourselves!

@icehaunter
Copy link
Contributor

I want the next upgrade to be cleaner, so I'll merge in a different version preserving a git subtree addition merge commit (and using squashed history) - it should make further upgrades possible with just a make command that currently fails. So I'll close this in favor of #9

@icehaunter icehaunter closed this Apr 22, 2025
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.