Re: BUG #7583: Problem using INHERITS and LIKE - Mailing list pgsql-bugs

From Bryan Love
Subject Re: BUG #7583: Problem using INHERITS and LIKE
Date
Msg-id CAJmodj32dJqCWxW+=-AfMx3xE-xRfhEVfmXR-nopONgURh-zVQ@mail.gmail.com
Whole thread Raw
In response to Re: BUG #7583: Problem using INHERITS and LIKE  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
Understood, thanks.

Our use case is that we want to copy the indexes from the parent table as
well, so we have to use (like ... including indexes).

On Thu, Oct 4, 2012 at 7:38 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

> bryan.love@iovation.com writes:
> > After creating a table using LIKE and INHERITS, if you drop a column from
> > the parent table that existed prior to creation of the child table, the
> > column will not be dropped from the child table.
>
> This is not a bug.  LIKE says the column isn't inherited, so it exists
> in the child independently of whether it exists in the parent.
>
> Or, if you want to add it up: the child starts out with one local
> definition of the column (from LIKE) and one inherited (from INHERITS).
> Dropping the column from the parent removes the latter, but you still
> have the former, so the column stays.
>
> > =# create table bar (like foo) inherits (foo);
>
> Just out of curiosity, is there any actual use-case for such a silly
> thing?
>
>                         regards, tom lane
>

pgsql-bugs by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: BUG #7573: data loss in corner case using delete_old_cluster.sh (pg_upgrade)
Next
From: Bo Thorbjørn Jensen
Date:
Subject: exception 0xC0000005 PostgreSQL 9.1.6 on Windows Server 2008 R2