pgsql: Preserve RangeTblEntry.relid when expanding a view RTE.

2025-03-12 Thread Tom Lane
Preserve RangeTblEntry.relid when expanding a view RTE. When the rewriter converts an RTE_RELATION RTE for a view into an RTE_SUBQUERY RTE containing the view's defining query, leave the relid field alone instead of zeroing it. This allows the planner to tell that the subquery came from a view ra

pgsql: Preserve RangeTblEntry.relid when expanding a view RTE.

2025-03-12 Thread Tom Lane
Preserve RangeTblEntry.relid when expanding a view RTE. When the rewriter converts an RTE_RELATION RTE for a view into an RTE_SUBQUERY RTE containing the view's defining query, leave the relid field alone instead of zeroing it. This allows the planner to tell that the subquery came from a view ra

pgsql: Preserve RangeTblEntry.relid when expanding a view RTE.

2025-03-12 Thread Tom Lane
Preserve RangeTblEntry.relid when expanding a view RTE. When the rewriter converts an RTE_RELATION RTE for a view into an RTE_SUBQUERY RTE containing the view's defining query, leave the relid field alone instead of zeroing it. This allows the planner to tell that the subquery came from a view ra