| From: | "Thomas Hallgren" <thhal(at)mailblocks(dot)com> |
|---|---|
| To: | pgsql-hackers(at)postgresql(dot)org |
| Subject: | Re: warning missing |
| Date: | 2004-06-23 09:01:13 |
| Message-ID: | cbc7p4$2iep$1@news.hub.org |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
"Gaetano Mendola" <mendola(at)bigfoot(dot)com> writes:
> Tom Lane wrote:
>
> > Gaetano Mendola <mendola(at)bigfoot(dot)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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Bruce Momjian | 2004-06-23 10:14:15 | COPY security fix |
| Previous Message | Simon Riggs | 2004-06-23 08:46:40 | Re: PITR Recovery |