pgsql: Refactor to avoid code duplication in transformPLAssignStmt.

2025-09-27 Thread Tom Lane
Refactor to avoid code duplication in transformPLAssignStmt. transformPLAssignStmt contained many lines cribbed directly from transformSelectStmt. I had supposed that we could manage to keep the two copies in sync, but the bug just fixed in 7504d2be9 shows that that hope was foolish. Let's refac

pgsql: Fix missed copying of groupDistinct in transformPLAssignStmt.

2025-09-27 Thread Tom Lane
Fix missed copying of groupDistinct in transformPLAssignStmt. Because we failed to do this, DISTINCT in GROUP BY DISTINCT would be ignored in PL/pgSQL assignment statements. It's not surprising that no one noticed, since such statements will throw an error if the query produces more than one row.

pgsql: Fix missed copying of groupDistinct in transformPLAssignStmt.

2025-09-27 Thread Tom Lane
Fix missed copying of groupDistinct in transformPLAssignStmt. Because we failed to do this, DISTINCT in GROUP BY DISTINCT would be ignored in PL/pgSQL assignment statements. It's not surprising that no one noticed, since such statements will throw an error if the query produces more than one row.

pgsql: Fix missed copying of groupDistinct in transformPLAssignStmt.

2025-09-27 Thread Tom Lane
Fix missed copying of groupDistinct in transformPLAssignStmt. Because we failed to do this, DISTINCT in GROUP BY DISTINCT would be ignored in PL/pgSQL assignment statements. It's not surprising that no one noticed, since such statements will throw an error if the query produces more than one row.

pgsql: Fix missed copying of groupDistinct in transformPLAssignStmt.

2025-09-27 Thread Tom Lane
Fix missed copying of groupDistinct in transformPLAssignStmt. Because we failed to do this, DISTINCT in GROUP BY DISTINCT would be ignored in PL/pgSQL assignment statements. It's not surprising that no one noticed, since such statements will throw an error if the query produces more than one row.

pgsql: Fix missed copying of groupDistinct in transformPLAssignStmt.

2025-09-27 Thread Tom Lane
Fix missed copying of groupDistinct in transformPLAssignStmt. Because we failed to do this, DISTINCT in GROUP BY DISTINCT would be ignored in PL/pgSQL assignment statements. It's not surprising that no one noticed, since such statements will throw an error if the query produces more than one row.

pgsql: Fix missed copying of groupDistinct in transformPLAssignStmt.

2025-09-27 Thread Tom Lane
Fix missed copying of groupDistinct in transformPLAssignStmt. Because we failed to do this, DISTINCT in GROUP BY DISTINCT would be ignored in PL/pgSQL assignment statements. It's not surprising that no one noticed, since such statements will throw an error if the query produces more than one row.

pgsql: Teach MSVC that elog/ereport ERROR doesn't return

2025-09-27 Thread David Rowley
Teach MSVC that elog/ereport ERROR doesn't return It had always been intended that this already works correctly as pg_unreachable() uses __assume(0) on MSVC, and that directs the compiler in a way so it knows that a given function won't return. However, with ereport_domain(), it didn't work... I