pgsql: Fix internal error from CollateExpr in SQL/JSON DEFAULT expressi

2025-10-08 Thread Amit Langote
Fix internal error from CollateExpr in SQL/JSON DEFAULT expressions SQL/JSON functions such as JSON_VALUE could fail with "unrecognized node type" errors when a DEFAULT clause contained an explicit COLLATE expression. That happened because assign_collations_walker() could invoke exprSetCollation()

pgsql: Make truncate_useless_pathkeys() consider WindowFuncs

2025-10-08 Thread David Rowley
Make truncate_useless_pathkeys() consider WindowFuncs truncate_useless_pathkeys() seems to have neglected to account for PathKeys that might be useful for WindowClause evaluation. Modify it so that it properly accounts for that. Making this work required adjusting two things: 1. Change from che

pgsql: bufmgr: Fix signedness of mask variable in BufferSync()

2025-10-08 Thread Andres Freund
bufmgr: Fix signedness of mask variable in BufferSync() BM_PERMANENT is defined as 1U<<31, which is a negative number when interpreted as a signed integer. Unfortunately the mask variable in BufferSync() was signed. This has been wrong for a long time, but failed to fail, due to integer conversion

pgsql: Allow negative aggtransspace to indicate unbounded state size

2025-10-08 Thread Richard Guo
Allow negative aggtransspace to indicate unbounded state size This patch reuses the existing aggtransspace in pg_aggregate to signal that an aggregate's transition state can grow unboundedly. If aggtransspace is set to a negative value, it now indicates that the transition state may consume unpre