Re: Odd behavior of partitioned ALTER TABLE ONLY ... ADD PRIMARY KEY

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Odd behavior of partitioned ALTER TABLE ONLY ... ADD PRIMARY KEY
Date: 2019-04-21 19:36:13
Message-ID: 20190421193613.GA13330@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2019-Apr-21, Tom Lane wrote:

> ISTM that this is a bug, not a feature: if there's any point at
> all to saying ONLY in this context, it's that we're not supposed
> to be doing anything as expensive as adding a new constraint to
> a child partition. No? So I think that this should have failed.

Hmm, yeah, this is not intentional and I agree that it shouldn't be
doing this.

> We need to require the partition(s) to already have attnotnull set.

Sounds good to me, yes.

Do you want me to see about this?

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-04-21 19:40:29 Re: Odd behavior of partitioned ALTER TABLE ONLY ... ADD PRIMARY KEY
Previous Message Fabien COELHO 2019-04-21 19:31:16 Re: [PATCH v1] Add \echo_stderr to psql