Alvaro Herrera kirjutas E, 23.09.2002 kell 10:30: > En 23 Sep 2002 10:23:06 +0200 > Hannu Krosing <[EMAIL PROTECTED]> escribió: > > > Tom Lane kirjutas P, 22.09.2002 kell 18:56: > > > > It seems to me that DROP ONLY should set attislocal true on each child > > > for which it decrements the inherit count, whether the count reaches > > > zero or not. > > > > This would not be what I e'd expect - if c inherited f1 twice and then > > one of the parents disinherits it, then it would still be inherited from > > the other parent > > The problem with this is that two sequences of commands only differing > in the ordering of two clauses give different result:
IMHO this is the correct behaviour > create table p1 (f1 int, f2 int); > create table p2 (f1 int, f2 int); > create table c () inherits (p1, p2); > alter table only p1 drop column f1; Here you get rid of f1 in p1 _only_, i.e you keep it in children. > alter table p2 drop column f1; At this point c.f1 is inherited from only p2 and should be dropped > create table p1 (f1 int, f2 int); > create table p2 (f1 int, f2 int); > create table c () inherits (p1, p2); > alter table p2 drop column f1; Here c.f1 is still inherited from p1 and thus will not be dropped > alter table only p1 drop column f1; If you say ONLY you _do_ mean "don't drop from child tables". > The former drops f1 from c, while the latter does not. It's > inconsistent. But this is what _should_ happen. It is quite unreasonable to expect that order of commands makes no difference. ------------ Hannu ---------------------------(end of broadcast)--------------------------- TIP 6: Have you searched our list archives? http://archives.postgresql.org