Closed jobinau closed 3 years ago
The default partition needs to be identified. One of the approximate way to check the length of the relpartbound of the pg_class. For example,
postgres=# SELECT relname,length(relpartbound) from pg_class where oid in (91975,91978,91981,91996);
relname | length
---------------------------+--------
emp_2020-11-30_2020-12-01 | 547
emp_2020-12-01_2020-12-02 | 547
emp_default | 133
emp_2019-01-01_2020-11-30 | 547
(4 rows)
The exact way to check whether it is a default partition is to check is_default true
in relpartbound
Final thought was to use pg_catalog.pg_get_expr(c.relpartbound, c.oid) != 'DEFAULT'
as it is more explicit
Issue is fixed in 3.2 code base
Partition tables with default partitions are reported to be failing.