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

Re: warning missing

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 (view raw or flat)
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


In response to

Responses

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2004-06-23 10:14:15
Subject: COPY security fix
Previous:From: Simon RiggsDate: 2004-06-23 08:46:40
Subject: Re: PITR Recovery

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