On 2018/11/09 14:04, Amit Langote wrote:
> On 2018/11/09 4:39, Alvaro Herrera wrote:
>> and if somebody has it, a change to how defaults are applied
>> when routing tuples.
>
> I haven't written such a patch yet. Do we want such a feature?
Or is it a *bug* of tuple-routing that it doesn't substitute default
values that may be defined for partitions? It kind of looks like one if
you see an example like this.
create table p (a int, b int) partition by list (a);
create table p1 partition of p (b not null default 1) for values in (1);
insert into p1 values (1);
table p;
a │ b
───┼───
1 │ 1
(1 row)
insert into p values (1);
ERROR: null value in column "b" violates not-null constraint
DETAIL: Failing row contains (1, null).
Thanks,
Amit