Skip site navigation (1) Skip section navigation (2)

Re: BUG #7583: Problem using INHERITS and LIKE

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: bryan(dot)love(at)iovation(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #7583: Problem using INHERITS and LIKE
Date: 2012-10-04 14:38:35
Message-ID: 25218.1349361515@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
bryan(dot)love(at)iovation(dot)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


In response to

Responses

pgsql-bugs by date

Next:From: Bryan LoveDate: 2012-10-04 17:24:03
Subject: Re: BUG #7583: Problem using INHERITS and LIKE
Previous:From: Amit KapilaDate: 2012-10-04 12:27:52
Subject: Re: BUG #7534: walreceiver takes long time to detect n/w breakdown

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group