Re: error-free disabling of individual child partition

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Hannu Krosing <hannu(at)skype(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Simon Riggs <simon(at)2ndquadrant(dot)com>, Csaba Nagy <nagy(at)ecircle-ag(dot)com>, Zeugswetter Andreas DCP SD <ZeugswetterA(at)spardat(dot)at>, Andrew Dunstan <andrew(at)dunslane(dot)net>, April Lorenzen <outboundindex(at)gmail(dot)com>, postgres hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: error-free disabling of individual child partition
Date: 2006-05-24 15:16:04
Message-ID: 20060524151603.GG3159@surnet.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hannu Krosing wrote:
> Ühel kenal päeval, K, 2006-05-24 kell 09:40, kirjutas Tom Lane:
> > Simon Riggs <simon(at)2ndquadrant(dot)com> writes:
> > > On Wed, 2006-05-24 at 11:17 +0300, Hannu Krosing wrote:
> > >> Why "never set back again" ? I'd guess that it should be set back to
> > >> true when it is not an inherited column anymore, that is when its
> > >> attinhcount reaches zero.
> >
> > > Because you have no record of whether it was created locally or
> > > inherited when originally created. And: do you care? Why?
> >
> > The invariant is supposed to be that every attribute has attislocal
> > true or attinhcount > 0 (or both).
>
> In what case does it have both ?

create table parent (foo int);
create table child (foo int) inherits (parent);

In the child, the column is local but it's also inherited from parent.
So if you drop the column from the parent, it should be kept in the
child.

> > Otherwise it has no justification
> > to exist. I see in the regression database that someone has broken
> > this invariant; it looks like LIKE inheritance is misimplemented.
>
> I don't think that LIKE inheritance is inheritance at all, rather it is
> a create-time macro.

In that case the columns should be marked attislocal.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2006-05-24 15:27:27 Re: error-free disabling of individual child partition
Previous Message Hannu Krosing 2006-05-24 14:41:43 Re: error-free disabling of individual child partition