pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Amit Langote <Langote_Amit_f8@lab.ntt.co.jp>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: Jürgen Strobel <juergen+postgresql@strobel.info>
Cc: Amit Langote <amitlangote09@gmail.com>
Cc: Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: BUG #15212: Default values in partition tables don't work as expected and allow NOT NULL violation
Date: Mon, 12 Nov 2018 13:17:35 +0900
Message-ID: <dd9a44a1-e7a5-4a2e-2830-afdd793cdb9c@lab.ntt.co.jp> (raw)
In-Reply-To: <6676.1541995199@sss.pgh.pa.us>
References: <20181109170712.pfn55lab5j7oae4v@alvherre.pgsql>
	<29152.1541802819@sss.pgh.pa.us>
	<f45328d3-70ef-2186-fd6d-6ec58e3d951f@lab.ntt.co.jp>
	<6676.1541995199@sss.pgh.pa.us>

On 2018/11/12 12:59, Tom Lane wrote:
> Amit Langote <Langote_Amit_f8@lab.ntt.co.jp> writes:
>> On 2018/11/10 7:33, Tom Lane wrote:
>>> I'd argue not, actually.  I think there is plausible precedent in
>>> updatable views, where what we use is the defaults associated with the
>>> view, not the underlying table.  Correspondingly, what ought to govern
>>> in a partitioned insert is the defaults associated with the table actually
>>> named in the insert command, never mind what its partitions might say.
>>> That is useful for many situations, and it avoids all the logical
>>> inconsistencies you get into if you find that the defaults associated
>>> with some partition would force re-routing elsewhere.
> 
>> ...
>> IOW, it might be a good idea to call the ability to set partition-level
>> defaults a deprecated feature?
> 
> Not necessarily.  They'd apply when you insert directly into a particular
> partition by name.

Yes.  Maybe, we should document that the partition default are not honored
when inserting through the parent.

Thanks,
Amit





view thread (43+ messages)  latest in thread

Message-ID: <dd9a44a1-e7a5-4a2e-2830-afdd793cdb9c@lab.ntt.co.jp>
Permalink:  ../dd9a44a1-e7a5-4a2e-2830-afdd793cdb9c@lab.ntt.co.jp/
Also on:    postgresql.org/message-id/dd9a44a1-e7a5-4a2e-2830-afdd793cdb9c@lab.ntt.co.jp

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: Langote_Amit_f8@lab.ntt.co.jp, tgl@sss.pgh.pa.us, alvherre@2ndquadrant.com, juergen+postgresql@strobel.info, amitlangote09@gmail.com, ashutosh.bapat@enterprisedb.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: BUG #15212: Default values in partition tables don't work as expected and allow NOT NULL violation
  In-Reply-To: <dd9a44a1-e7a5-4a2e-2830-afdd793cdb9c@lab.ntt.co.jp>
  References: <20181109170712.pfn55lab5j7oae4v@alvherre.pgsql> <29152.1541802819@sss.pgh.pa.us> <f45328d3-70ef-2186-fd6d-6ec58e3d951f@lab.ntt.co.jp> <6676.1541995199@sss.pgh.pa.us> <dd9a44a1-e7a5-4a2e-2830-afdd793cdb9c@lab.ntt.co.jp>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox