Re: Minor correction in alter_table.sgml

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Amit Langote <amitlangote09(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Minor correction in alter_table.sgml
Date: 2016-12-23 13:31:19
Message-ID: 20161223133119.GZ18360@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Amit,

* Amit Langote (amitlangote09(at)gmail(dot)com) wrote:
> On Fri, Dec 23, 2016 at 12:07 AM, Stephen Frost <sfrost(at)snowman(dot)net> wrote:
> > * Tom Lane (tgl(at)sss(dot)pgh(dot)pa(dot)us) wrote:
> >> (Of course, maybe the question we ought to be asking here is why
> >> ATTACH/DETACH PARTITION failed to go with the flow and be a
> >> combinable action.)
> >
> > I did wonder that myself but havne't looked at the code. I'm guessing
> > there's a reason it's that way.
>
> I thought the possibility of something like the following happening
> should be avoided:
>
> alter table p attach partition p1 for values in (1, 2, 3), add b int;
> ERROR: child table is missing column "b"

Sure, but what about something like:

alter table p attach partition p1 for values in (1, 2, 3), alter column
b set default 1; ?

> Although, the same can be said about ALTER TABLE child INHERIT parent, I guess.

Certainly seems like that's an indication that there are use-cases for
allowing it then. We do tend to avoid arbitrary restrictions and if
there isn't really anything code-level for ATTACH/DETACH partition to be
this way then we change it to be allowed.

Thanks!

Stephen

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2016-12-23 13:47:14 Re: Clarifying "server starting" messaging in pg_ctl start without --wait
Previous Message Anastasia Lubennikova 2016-12-23 13:12:22 Re: Parallel Index Scans