"Gaetano Mendola" <mendola@bigfoot.com> writes:
> Tom Lane wrote:
>
> > Gaetano Mendola <mendola@bigfoot.com> writes:
> >
> >>I think a warning is missing if I create a table without OIDS that
> >>inherits from a table with oids:
> >
> >
> >>don't you think a warning shall to be raised here ?
> >
> >
> > Nope ... this is not different from the behavior for merging duplicate
> > column definitions. You get an OID column if the child table definition
> > *or* any parent table requests OIDs.
>
> Mmm, you are not convincing me, don't we break the principle of minor
surprise?
>
> I mean if you duplicate a column name that column is present on the
inherited
> table, but if I say: I don't want the column OID and I found it, this
then
> surprise me.
>
Speaking in generic OO terms, using inheritance, you cannot remove
attributes that are present in the generalisation. If B inherits A, an
instance of B is per definition also an instance of A. Thus, you must alwasy
be able to cast a B into an A. In short, If you don't want the OID, you
cannot inherit a something that has an OID.
Having said that, I think a warning is motivated. The warning should state
that attributes (columns) present in the generalisation (the parent table)
cannot be hidden.
Kind regards,
Thomas Hallgren