Hi,
I have rebased the patch on the latest commit.
PFA.
There exists one issue reported by Rajkumar[1] off-line as following, where
describing the default partition after deleting null partition, does not show
updated constraints. I am working on fixing this issue.
create table t1 (c1 int) partition by list (c1);
create table t11 partition of t1 for values in (1,2);
create table t12 partition of t1 default;
create table t13 partition of t1 for values in (10,11);
create table t14 partition of t1 for values in (null);
postgres=# \d+ t12
Table "public.t12"
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
--------+---------+-----------+----------+---------+---------+--------------+-------------
c1 | integer | | | | plain | |
Partition of: t1 DEFAULT
Partition constraint: ((c1 IS NOT NULL) AND (c1 <> ALL (ARRAY[1, 2, 10, 11])))
postgres=# alter table t1 detach partition t14;
ALTER TABLE
postgres=# \d+ t12
Table "public.t12"
Column | Type | Collation | Nullable | Default | Storage | Stats target | Description
--------+---------+-----------+----------+---------+---------+--------------+-------------
c1 | integer | | | | plain | |
Partition of: t1 DEFAULT
Partition constraint: ((c1 IS NOT NULL) AND (c1 <> ALL (ARRAY[1, 2, 10, 11])))
postgres=# insert into t1 values(null);
INSERT 0 1
Note that the parent correctly allows the nulls to be inserted.
Regards,
Jeevan Ladhe