pgsql: Don't call simplify_aggref with a NULL PlannerInfo

2025-11-29 Thread David Rowley
Don't call simplify_aggref with a NULL PlannerInfo 42473b3b3 added prosupport infrastructure to allow simplification of Aggrefs during constant-folding. In some cases the context->root that's given to eval_const_expressions_mutator() can be NULL. 42473b3b3 failed to take that into account, which

pgsql: Update obsolete row compare preprocessing comments.

2025-11-29 Thread Peter Geoghegan
Update obsolete row compare preprocessing comments. We have some limited ability to detect redundant and contradictory conditions involving an nbtree row comparison key following commits f09816a0 and bd3f59fd: we can do so in simple cases involving IS NULL and IS NOT NULL keys on a row compare key

pgsql: Update obsolete row compare preprocessing comments.

2025-11-29 Thread Peter Geoghegan
Update obsolete row compare preprocessing comments. We have some limited ability to detect redundant and contradictory conditions involving an nbtree row comparison key following commits f09816a0 and bd3f59fd: we can do so in simple cases involving IS NULL and IS NOT NULL keys on a row compare key

pgsql: Avoid rewriting data-modifying CTEs more than once.

2025-11-29 Thread Dean Rasheed
Avoid rewriting data-modifying CTEs more than once. Formerly, when updating an auto-updatable view, or a relation with rules, if the original query had any data-modifying CTEs, the rewriter would rewrite those CTEs multiple times as RewriteQuery() recursed into the product queries. In most cases t

pgsql: Avoid rewriting data-modifying CTEs more than once.

2025-11-29 Thread Dean Rasheed
Avoid rewriting data-modifying CTEs more than once. Formerly, when updating an auto-updatable view, or a relation with rules, if the original query had any data-modifying CTEs, the rewriter would rewrite those CTEs multiple times as RewriteQuery() recursed into the product queries. In most cases t

pgsql: Avoid rewriting data-modifying CTEs more than once.

2025-11-29 Thread Dean Rasheed
Avoid rewriting data-modifying CTEs more than once. Formerly, when updating an auto-updatable view, or a relation with rules, if the original query had any data-modifying CTEs, the rewriter would rewrite those CTEs multiple times as RewriteQuery() recursed into the product queries. In most cases t

pgsql: Avoid rewriting data-modifying CTEs more than once.

2025-11-29 Thread Dean Rasheed
Avoid rewriting data-modifying CTEs more than once. Formerly, when updating an auto-updatable view, or a relation with rules, if the original query had any data-modifying CTEs, the rewriter would rewrite those CTEs multiple times as RewriteQuery() recursed into the product queries. In most cases t

pgsql: Avoid rewriting data-modifying CTEs more than once.

2025-11-29 Thread Dean Rasheed
Avoid rewriting data-modifying CTEs more than once. Formerly, when updating an auto-updatable view, or a relation with rules, if the original query had any data-modifying CTEs, the rewriter would rewrite those CTEs multiple times as RewriteQuery() recursed into the product queries. In most cases t

pgsql: Avoid rewriting data-modifying CTEs more than once.

2025-11-29 Thread Dean Rasheed
Avoid rewriting data-modifying CTEs more than once. Formerly, when updating an auto-updatable view, or a relation with rules, if the original query had any data-modifying CTEs, the rewriter would rewrite those CTEs multiple times as RewriteQuery() recursed into the product queries. In most cases t