From: Tom Lane <tgl@sss.pgh.pa.us>
To: bryan.love@iovation.com
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #7583: Problem using INHERITS and LIKE
Date: Thu, 04 Oct 2012 10:38:35 -0400
Message-ID: <25218.1349361515@sss.pgh.pa.us> (raw)
In-Reply-To: <E1TJVgR-0003GE-Rs@wrigleys.postgresql.org>
References: <E1TJVgR-0003GE-Rs@wrigleys.postgresql.org>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, bryan.love@iovation.com
Subject: Re: BUG #7583: Problem using INHERITS and LIKE
In-Reply-To: <25218.1349361515@sss.pgh.pa.us>
References: <E1TJVgR-0003GE-Rs@wrigleys.postgresql.org> <25218.1349361515@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox