pgsql: Attempt to fix newly added Memoize regression test

2024-01-26 Thread David Rowley
Attempt to fix newly added Memoize regression test Both drongo and fairywren seem not to like a new regression test added by 2cca95e17. These machines show a different number of actual rows in the EXPLAIN ANALYZE output. Since the number of actual rows is divided by the number of loops, I suspec

pgsql: Compare varnullingrels too in assign_param_for_var().

2024-01-26 Thread Tom Lane
Compare varnullingrels too in assign_param_for_var(). Oversight in 2489d76c4. Preliminary analysis suggests that the problem may be unreachable --- but if we did have instances of the same column with different varnullingrels, we'd surely need to treat them as different Params. Discussion: https

pgsql: Compare varnullingrels too in assign_param_for_var().

2024-01-26 Thread Tom Lane
Compare varnullingrels too in assign_param_for_var(). Oversight in 2489d76c4. Preliminary analysis suggests that the problem may be unreachable --- but if we did have instances of the same column with different varnullingrels, we'd surely need to treat them as different Params. Discussion: https

pgsql: Detect Julian-date overflow in timestamp[tz]_pl_interval.

2024-01-26 Thread Tom Lane
Detect Julian-date overflow in timestamp[tz]_pl_interval. We perform addition of the days field of an interval via arithmetic on the Julian-date representation of the timestamp's date. This step is subject to int32 overflow, and we also should not let the Julian date become very negative, for fear

pgsql: Detect Julian-date overflow in timestamp[tz]_pl_interval.

2024-01-26 Thread Tom Lane
Detect Julian-date overflow in timestamp[tz]_pl_interval. We perform addition of the days field of an interval via arithmetic on the Julian-date representation of the timestamp's date. This step is subject to int32 overflow, and we also should not let the Julian date become very negative, for fear

pgsql: Detect Julian-date overflow in timestamp[tz]_pl_interval.

2024-01-26 Thread Tom Lane
Detect Julian-date overflow in timestamp[tz]_pl_interval. We perform addition of the days field of an interval via arithmetic on the Julian-date representation of the timestamp's date. This step is subject to int32 overflow, and we also should not let the Julian date become very negative, for fear

pgsql: Detect Julian-date overflow in timestamp[tz]_pl_interval.

2024-01-26 Thread Tom Lane
Detect Julian-date overflow in timestamp[tz]_pl_interval. We perform addition of the days field of an interval via arithmetic on the Julian-date representation of the timestamp's date. This step is subject to int32 overflow, and we also should not let the Julian date become very negative, for fear

pgsql: Detect Julian-date overflow in timestamp[tz]_pl_interval.

2024-01-26 Thread Tom Lane
Detect Julian-date overflow in timestamp[tz]_pl_interval. We perform addition of the days field of an interval via arithmetic on the Julian-date representation of the timestamp's date. This step is subject to int32 overflow, and we also should not let the Julian date become very negative, for fear

pgsql: Detect Julian-date overflow in timestamp[tz]_pl_interval.

2024-01-26 Thread Tom Lane
Detect Julian-date overflow in timestamp[tz]_pl_interval. We perform addition of the days field of an interval via arithmetic on the Julian-date representation of the timestamp's date. This step is subject to int32 overflow, and we also should not let the Julian date become very negative, for fear

pgsql: Temporary patch to help debug pg_walsummary test failures.

2024-01-26 Thread Robert Haas
Temporary patch to help debug pg_walsummary test failures. The tests in 002_blocks.pl are failing in the buildfarm from time to time, but we don't know how to reproduce the failure elsewhere. The most obvious explanation seems to be the unexpected disappearance of a WAL summary file, so bump up th

pgsql: Combine FSM updates for prune and no-prune cases.

2024-01-26 Thread Robert Haas
Combine FSM updates for prune and no-prune cases. lazy_scan_prune() and lazy_scan_noprune() update the freespace map with identical conditions; combine them. This consolidation is easier now that cb970240f13df2b63f0410f81f452179a2b78d6f moved visibility map updates into lazy_scan_prune(). While c

pgsql: Split some code out from MergeAttributes()

2024-01-26 Thread Peter Eisentraut
Split some code out from MergeAttributes() - Separate function to merge a child attribute into matching inherited attribute: The logic to merge a child attribute into matching inherited attribute in MergeAttribute() is only applicable to regular inheritance child. The code is isolated and c

pgsql: Make spelling of cancelled/cancellation consistent

2024-01-26 Thread Alvaro Herrera
Make spelling of cancelled/cancellation consistent This fixes places where words derived from cancel were not using their common en-US ugly^H^H^H^Hspelling. Author: Jelte Fennema-Nio Reported-by: Thomas Munro Discussion: https://postgr.es/m/ca+hukg+lrq+ty6ywxf5572qnq8kwxgwg5n4fseccuap685n...@m

pgsql: MergeAttributes code deduplication

2024-01-26 Thread Peter Eisentraut
MergeAttributes code deduplication The code handling NOT NULL constraints is duplicated in blocks merging the attribute definition incrementally. Deduplicate that code. Author: Ashutosh Bapat Discussion: https://www.postgresql.org/message-id/flat/52a125e4-ff9a-95f5-9f61-b87cf447e...@eisentraut

pgsql: Reindex toast before its main relation in reindex_relation()

2024-01-26 Thread Michael Paquier
Reindex toast before its main relation in reindex_relation() This commit changes the order of reindex on a relation so as a toast relation is processed before its main relation. The original order, where a rebuild was first done for the indexes on the main table, could be a problem in the event o