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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jürgen Strobel <juergen+postgresql(at)strobel(dot)info>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #15212: Default values in partition tables don't work as expected and allow NOT NULL violation
Date: 2018-11-12 23:57:19
Message-ID: 10299.1542067039@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

=?UTF-8?Q?J=c3=bcrgen_Strobel?= <juergen+postgresql(at)strobel(dot)info> 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 any.

> I think I missed something, what are the *introduced* logical problems?

What to do if a partition introduces a default value that would force
re-routing to some other partition.

> Apart from implementation issues the only logical problems I see are if
> you allow to change defaults of the partition key columns, and these are
> problematic (nonsensical really) in either case.

Just claiming that it's nonsensical doesn't fix the problem. Also, it
is neither problematic nor nonsensical for the root to provide defaults
for partition key columns. So if we go this route, we are giving up
useful behavior (key-column defaults on the root) for useless behavior
(key-column defaults on the partitions).

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Thomas Munro 2018-11-13 04:54:15 Re: BUG #15495: Ldap authentication not working with multiple server in Postgresql 11
Previous Message Jürgen Strobel 2018-11-12 23:06:45 Re: BUG #15212: Default values in partition tables don't work as expected and allow NOT NULL violation

Browse pgsql-hackers by date

  From Date Subject
Next Message Michael Paquier 2018-11-13 00:04:57 Re: Removal of unnecessary CommandCounterIncrement() when doing ON COMMIT DELETE ROWS
Previous Message Tom Lane 2018-11-12 23:53:21 Re: [HACKERS] Decimal64 and Decimal128