pg_lake_table: allow debug plan output for restriction nodes - #486
Open
marknefedov wants to merge 4 commits into
Open
pg_lake_table: allow debug plan output for restriction nodes#486marknefedov wants to merge 4 commits into
marknefedov wants to merge 4 commits into
Conversation
added 2 commits
July 26, 2026 14:44
Signed-off-by: Mark Nefedov <mvnefedov@avito.ru>
Signed-off-by: Mark Nefedov <mvnefedov@avito.ru>
marknefedov
marked this pull request as ready for review
July 26, 2026 12:13
marknefedov
requested review from
sfc-gh-abozkurt,
sfc-gh-amzheng,
sfc-gh-dachristensen,
sfc-gh-mslot,
sfc-gh-npuka and
sfc-gh-okalaci
as code owners
July 26, 2026 12:13
marknefedov
marked this pull request as draft
July 27, 2026 10:28
added 2 commits
July 27, 2026 14:29
Signed-off-by: Mark Nefedov <mvnefedov@avito.ru>
Signed-off-by: Mark Nefedov <mvnefedov@avito.ru>
marknefedov
marked this pull request as ready for review
July 27, 2026 11:54
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
PostgreSQL diagnostic node printing walks the private data attached to planned
scan nodes. Both pg_lake scan paths store
PlannerRelationRestrictionextensible nodes in that private data:
CustomScan.custom_privateForeignScan.fdw_privatePostgreSQL calls the registered
nodeOutcallback when it prints either plan.That callback previously raised
ERROR: out not implemented, so the diagnosticconfiguration reported in #106 (
pg_ctl ... -o "-d 5") could make an otherwisevalid lake-table query fail during planning.
Solution
Add a dedicated output function for
PlannerRelationRestriction.The callback follows PostgreSQL's node-output convention and emits both private
fields:
rtebaseRestrictionListPostgreSQL continues to emit the extensible-node type and name itself. The
private fields are delegated to
outNode, so nestedRangeTblEntryandRestrictInfonodes, as well as NULL or empty lists, use PostgreSQL's existingformatting behavior.
nodeReadremains unsupported because this node is transient plannerbookkeeping and pg_lake does not deserialize it from text. The
DEFINE_NODE_METHODSmacro now selectsOut##type, requiring each futurepg_lake extensible-node type to define its own output behavior.
Regression coverage
The new test enables
debug_print_plan, routes itsLOGoutput to the client,and exercises:
Custom Scan (Query Pushdown)with full-query pushdown enabledForeign Scanwith full-query pushdown disabledWHEREclauseFor every case, the test verifies the expected scan type, successful execution,
and diagnostic output containing
PlannerRelationRestriction,rte, andbaseRestrictionList.Validation
pgindent --check --diffpg_lake_table.sotest_relation_restriction.py::test_debug_print_plan_with_lake_tableFixes #106.