BUG #15212: Default values in partition tables don't work as expected and allow NOT NULL violation

2018-11-09 Thread Jürgen Strobel
On 2018-11-09 16:59, Alvaro Herrera wrote: > On 2018-Nov-09, Amit Langote wrote: > >> 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

Re: BUG #15212: Default values in partition tables don't work as expected and allow NOT NULL violation

2018-11-09 Thread Jürgen Strobel
On 2018-11-09 18:07, Alvaro Herrera wrote: > On 2018-Nov-09, Jürgen Strobel wrote: > >> Regarding your example, what I expected is that *both* inserts would >> consistently result in a tuple of (1, 42) since p should route the >> insert to p1 and use p1's defau

Re: BUG #15212: Default values in partition tables don't work as expected and allow NOT NULL violation

2018-11-09 Thread Jürgen Strobel
On 2018-11-09 22:11, Alvaro Herrera wrote: > On 2018-Nov-09, Jürgen Strobel wrote: > >> I am slightly confused now, I thought this landmine was already fixed in >> master and what remains is only whether to backport it or not? Which I >> guess depends on whether this is cl

Re: BUG #15212: Default values in partition tables don't work as expected and allow NOT NULL violation

2018-11-12 Thread Jürgen Strobel
On 2018-11-09 23:33, Tom Lane wrote: > Alvaro Herrera writes: >> On 2018-Nov-09, Jürgen Strobel wrote: >>> Regarding your example, what I expected is that *both* inserts would >>> consistently result in a tuple of (1, 42) since p should route the >>> ins

Re: BUG #15212: Default values in partition tables don't work as expected and allow NOT NULL violation

2018-11-12 Thread Jürgen Strobel
On 2018-11-12 17:33, Tom Lane wrote: > Alvaro Herrera writes: >> One of the guiding principles that I think we should hold for >> partitioning is that operating directly into the partition should be >> seen as only an optimization compared to inserting into the parent table >> -- thus it should no

Re: BUG #15212: Default values in partition tables don't work as expected and allow NOT NULL violation

2018-11-13 Thread Jürgen Strobel
On 2018-11-13 00:57, Tom Lane wrote: > =?UTF-8?Q?J=c3=bcrgen_Strobel?= writes: >> On 2018-11-12 17:33, Tom Lane wrote: >>> I'm not entirely convinced that I buy that argument, especially not in >>> a case like this where it introduces logical inconsistencies where there >>> otherwise wouldn't be a