-- verify statistics is set
SELECT c.relname, a.attstattarget
FROM pg_attribute a
JOIN pg_class c ON a.attrelid = c.oid AND c.relname LIKE 'test\_idx%'
ORDER BY c.relname, a.attnum;
relname | attstattarget
-----------+---------------
test_idx | 4646
- test_idx2 | -1
+ test_idx2 |
test_idx2 | 10000
test_idx2 | 3737
(4 rows)
Changed
attstattarget
inpg_attribute
to useNullableDatum
, allowing null representation for default statistics target in PostgreSQL 17. https://github.com/postgres/postgres/commit/6a004f1be87d34cfe51acf2fe2552d2b08a79273