statatt_get_type() unconditionally converted multirange types to their underlying range type. This choice affected all the type information, like atttypid, atttyptype and operators. This made the bounds histogram work correctly (range type is required), but it was wrong for all the other stat kinds. MCV values for a multirange column should be parsed as multirange arrays, not range arrays. It also made the TYPTYPE_MULTIRANGE check for the range stats validation as dead code, since atttyptype was always TYPTYPE_RANGE after the conversion due to the centralized statatt_get_type(). pg_restore_extended_stats() handles the same case correctly: it keeps the original type and explicitly converts to the range type only at the point where range_histogram_bounds is built. The fix of this issue is simple: the multirange-to-range conversion needs to be moved from the centralized statatt_get_type() up to where attribute stats build their range_histogram_bounds, matching what is done for extended statistics restore. The regression tests for multiranges with attribute stats are extended to cover this case. Author: OpenAI Security Research Team Backpatch-through: 18 Security: CVE-2026-16238
PostgreSQL Database Management System
This directory contains the source code distribution of the PostgreSQL database management system.
PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, user-defined types and functions. This distribution also contains C language bindings.
Copyright and license information can be found in the file COPYRIGHT.
General documentation about this version of PostgreSQL can be found at https://www.postgresql.org/docs/19/. In particular, information about building PostgreSQL from the source code can be found at https://www.postgresql.org/docs/19/installation.html.
The latest version of this software, and related software, may be obtained at https://www.postgresql.org/download/. For more information look at our web site located at https://www.postgresql.org/.