Re: warning missing - Mailing list pgsql-hackers

From Gaetano Mendola
Subject Re: warning missing
Date
Msg-id 40D9D23F.3060907@bigfoot.com
Whole thread Raw
In response to Re: warning missing  ("Thomas Hallgren" <thhal@mailblocks.com>)
Responses Re: warning missing
List pgsql-hackers
Thomas Hallgren wrote:

> 
> 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.

This is not completely true:

struct B
{   void foo();
};


class D : public B
{   private:      void foo();
   public:      void bar();
};


as you can see a D "is a" B but the publich foo() doesn't
appartaint to D, at least an user of D could not use foo()


> 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.

Right.



Regards
Gaetano Mendola





pgsql-hackers by date:

Previous
From: Peter Martini
Date:
Subject: Re: BLOBs and a virtual file system
Next
From: Frank Wiles
Date:
Subject: Re: BLOBs and a virtual file system