pgsql: Multiple revisions to the GROUP BY reordering tests

2024-02-23 Thread Alexander Korotkov
Multiple revisions to the GROUP BY reordering tests Discussion: https://postgr.es/m/CAMbWs4-NKLa%2BSs%2BX%3DWR6h0x%3DT07YBJoAz70ZGHzc-2zcHUHb0A%40mail.gmail.com Author: Richard Guo Reviewed-by: Andrei Lepikhov, Alexander Korotkov Branch -- master Details --- https://git.postgresql.org/p

pgsql: Replace lateral references to removed rels in subqueries

2024-02-23 Thread Alexander Korotkov
Replace lateral references to removed rels in subqueries This commit introduces a new field 'sublevels_up' in ReplaceVarnoContext, and enhances replace_varno_walker() to: 1) recurse into subselects with sublevels_up increased, and 2) perform the replacement only when varlevelsup is equal to su

pgsql: Avoid dangling-pointer problem with partitionwise joins under GE

2024-02-23 Thread Tom Lane
Avoid dangling-pointer problem with partitionwise joins under GEQO. build_child_join_sjinfo creates a derived SpecialJoinInfo in the short-lived GEQO context, but afterwards the semi_rhs_exprs from that may be used in a UniquePath for a child base relation. This breaks the expectation that all bas

pgsql: Avoid dangling-pointer problem with partitionwise joins under GE

2024-02-23 Thread Tom Lane
Avoid dangling-pointer problem with partitionwise joins under GEQO. build_child_join_sjinfo creates a derived SpecialJoinInfo in the short-lived GEQO context, but afterwards the semi_rhs_exprs from that may be used in a UniquePath for a child base relation. This breaks the expectation that all bas

pgsql: Avoid dangling-pointer problem with partitionwise joins under GE

2024-02-23 Thread Tom Lane
Avoid dangling-pointer problem with partitionwise joins under GEQO. build_child_join_sjinfo creates a derived SpecialJoinInfo in the short-lived GEQO context, but afterwards the semi_rhs_exprs from that may be used in a UniquePath for a child base relation. This breaks the expectation that all bas

pgsql: Avoid dangling-pointer problem with partitionwise joins under GE

2024-02-23 Thread Tom Lane
Avoid dangling-pointer problem with partitionwise joins under GEQO. build_child_join_sjinfo creates a derived SpecialJoinInfo in the short-lived GEQO context, but afterwards the semi_rhs_exprs from that may be used in a UniquePath for a child base relation. This breaks the expectation that all bas

pgsql: Avoid dangling-pointer problem with partitionwise joins under GE

2024-02-23 Thread Tom Lane
Avoid dangling-pointer problem with partitionwise joins under GEQO. build_child_join_sjinfo creates a derived SpecialJoinInfo in the short-lived GEQO context, but afterwards the semi_rhs_exprs from that may be used in a UniquePath for a child base relation. This breaks the expectation that all bas

pgsql: Avoid dangling-pointer problem with partitionwise joins under GE

2024-02-23 Thread Tom Lane
Avoid dangling-pointer problem with partitionwise joins under GEQO. build_child_join_sjinfo creates a derived SpecialJoinInfo in the short-lived GEQO context, but afterwards the semi_rhs_exprs from that may be used in a UniquePath for a child base relation. This breaks the expectation that all bas

pgsql: Fix compiler warning on typedef redeclaration

2024-02-23 Thread Heikki Linnakangas
Fix compiler warning on typedef redeclaration bulk_write.c:78:3: error: redefinition of typedef 'BulkWriteState' is a C11 feature [-Werror,-Wtypedef-redefinition] } BulkWriteState; ^ ../../../../src/include/storage/bulk_write.h:20:31: note: previous definition is here typed

pgsql: Introduce a new smgr bulk loading facility.

2024-02-23 Thread Heikki Linnakangas
Introduce a new smgr bulk loading facility. The new facility makes it easier to optimize bulk loading, as the logic for buffering, WAL-logging, and syncing the relation only needs to be implemented once. It's also less error-prone: We have had a number of bugs in how a relation is fsync'd - or not

pgsql: Fix mistake in SQL features list

2024-02-23 Thread Peter Eisentraut
Fix mistake in SQL features list Fix for c9f57541d97: Feature F302-02 was renamed to F305, but that commit failed to delete the old line. Reported-by: Satoru Koizumi (小泉 悟) Discussion: https://www.postgresql.org/message-id/flat/17081469.645.14101429540172934386%40wrigleys.postgresql.org Br

pgsql: Fix mistake in SQL features list

2024-02-23 Thread Peter Eisentraut
Fix mistake in SQL features list Fix for c9f57541d97: Feature F302-02 was renamed to F305, but that commit failed to delete the old line. Reported-by: Satoru Koizumi (小泉 悟) Discussion: https://www.postgresql.org/message-id/flat/17081469.645.14101429540172934386%40wrigleys.postgresql.org Br