pgsql: Add regression expected-files for older OpenSSL in FIPS mode.

2025-09-20 Thread Tom Lane
Add regression expected-files for older OpenSSL in FIPS mode. In our previous discussions around making our regression tests pass in FIPS mode, we concluded that we didn't need to support the different error message wording observed with pre-3.0 OpenSSL. However there are still a few LTS distribut

pgsql: Don't generate fake "*SELECT*" or "*SELECT* %d" subquery aliases

2025-09-20 Thread Robert Haas
Don't generate fake "*SELECT*" or "*SELECT* %d" subquery aliases. rte->alias should point only to a user-written alias, but in these cases that principle was violated. Fixing this causes some regression test output changes: wherever rte->alias previously had a value and is now NULL, rte->eref is n

pgsql: Don't generate fake "ANY_subquery" aliases, either.

2025-09-20 Thread Robert Haas
Don't generate fake "ANY_subquery" aliases, either. This is just like the previous commit, but for a different invented alias name. Author: Robert Haas Reviewed-by: Tom Lane Discussion: https://postgr.es/m/ca+tgmoysymda2gvanzpmci084n+mvucv0bj0hpbs6uhmmn6...@mail.gmail.com Branch -- master

pgsql: Don't generate fake "*TLOCRN*" or "*TROCRN*" aliases, either.

2025-09-20 Thread Robert Haas
Don't generate fake "*TLOCRN*" or "*TROCRN*" aliases, either. This is just like the previous two commits, except that this fix actually doesn't change any regression test outputs. Author: Robert Haas Reviewed-by: Tom Lane Discussion: https://postgr.es/m/ca+tgmoysymda2gvanzpmci084n+mvucv0bj0hpb

pgsql: Report the correct is_temporary flag for column defaults.

2025-09-20 Thread Tom Lane
Report the correct is_temporary flag for column defaults. pg_event_trigger_dropped_objects() would report a column default object with is_temporary = false, even if it belongs to a temporary table. This seems clearly wrong, so adjust it to report the table's temp-ness. While here, refactor Event

pgsql: CREATE STATISTICS: improve misleading error message

2025-09-20 Thread Peter Eisentraut
CREATE STATISTICS: improve misleading error message The previous change (commit f225473cbae) was still not on target, because it talked about relation kinds, which are not what is being checked here. Provide a more accurate message. Reviewed-by: Tom Lane Discussion: https://postgr.es/m/CACJufx

pgsql: Fix memory leakage in nodeSubplan.c.

2025-09-20 Thread Tom Lane
Fix memory leakage in nodeSubplan.c. If the hash functions used for hashing tuples leaked any memory, we failed to clean that up, resulting in query-lifespan memory leakage in queries using hashed subplans. One way that could happen is if the values being hashed require de-toasting, since most of

pgsql: Fix incorrect file reference in guc.h

2025-09-20 Thread Michael Paquier
Fix incorrect file reference in guc.h GucSource_Names was documented as being in guc.c, but since 0a20ff54f5e6 it is located in guc_tables.c. The reference to the location of GucSource_Names is important, as GucSource needs to be kept in sync with GucSource_Names. Author: David G. Johnston Disc

pgsql: Report the correct is_temporary flag for column defaults.

2025-09-20 Thread Tom Lane
Report the correct is_temporary flag for column defaults. pg_event_trigger_dropped_objects() would report a column default object with is_temporary = false, even if it belongs to a temporary table. This seems clearly wrong, so adjust it to report the table's temp-ness. While here, refactor Event

pgsql: Fix description of WAL record blocks in hash_xlog.h

2025-09-20 Thread Michael Paquier
Fix description of WAL record blocks in hash_xlog.h hash_xlog.h included descriptions for the blocks used in WAL records that were was not completely consistent with how the records are generated, with one block missing for SQUEEZE_PAGE, and inconsistent descriptions used for block 0 in VACUUM_ONE

pgsql: Track the maximum possible frequency of non-MCE array elements.

2025-09-20 Thread Tom Lane
Track the maximum possible frequency of non-MCE array elements. The lossy-counting algorithm that ANALYZE uses to identify most-common array elements has a notion of cutoff frequency: elements with frequency greater than that are guaranteed to be collected, elements with smaller frequencies are no

pgsql: Fix oversights in pg_event_trigger_dropped_objects() fixes.

2025-09-20 Thread Tom Lane
Fix oversights in pg_event_trigger_dropped_objects() fixes. Commit a0b99fc12 caused pg_event_trigger_dropped_objects() to not fill the object_name field for schemas, which it should have; and caused it to fill the object_name field for default values, which it should not have. In addition, trigge

pgsql: Add support for base64url encoding and decoding

2025-09-20 Thread Daniel Gustafsson
Add support for base64url encoding and decoding This adds support for base64url encoding and decoding, a base64 variant which is safe to use in filenames and URLs. base64url replaces '+' in the base64 alphabet with '-' and '/' with '_', thus making it safe for URL addresses and file systems. Sup

pgsql: Re-allow using statistics for bool-valued functions in WHERE.

2025-09-20 Thread Tom Lane
Re-allow using statistics for bool-valued functions in WHERE. Commit a391ff3c3, which added the ability for a function's support function to provide a custom selectivity estimate for "WHERE f(...)", unintentionally removed the possibility of applying expression statistics after finding there's no