title: Postgres Object-relation database doesn't seem to function properly
body: <p>I've defined my tables so:</p>
  
  <pre><code>create table device (
  id serial primary key,
  manufacturerid integer references manufacturer(id) on delete restrict,
  model text,
  price real,
  usagepros text,
  usagecons text
  );
  
  create table robot (
  numaxes integer,
  capacity real,
  reach real,
  accuracy real,
  installmethodid integer references installmethod(id) on delete restrict,
  mass real
  ) inherits (device);
  
  create table robotComplex(
  id serial primary key,
  name text
  );
  
  create table robotComplexDevice(
  id serial primary key,
  deviceId integer references device(id) on delete restrict,
  robotcomplexid integer references robotcomplex(id) on delete cascade
  );
  
  etc...
  </code></pre>
  
  <p>I get the following when running sql commands:</p>
  
  <pre><code> id  | manufacturerid | model | price | usagepros | usagecons | numaxes | capacity | reach | accuracy | installmethodid | mass  
  -----+----------------+-------+-------+-----------+-----------+---------+----------+-------+----------+-----------------+-------
   159 |            117 | Robot | 100.3 | OK        | NoOK      |       6 |     15.3 |  15.4 |  76.1234 |              45 | 100.1
  
  &gt; select * from device; 
   id  | manufacturerid | model | price | usagepros | usagecons 
  -----+----------------+-------+-------+-----------+-----------
   159 |            117 | Robot | 100.3 | OK        | NoOK
  
  &gt; select * from robotcomplex;
   id |     name     
  ----+--------------
   27 | Complex
  
  
  &gt; insert into robotcomplexdevice (deviceid, robotcomplexid) values (159, 27);
  ERROR:  insert or update on table "robotcomplexdevice" violates foreign key constraint        "robotcomplexdevice_deviceid_fkey"
  DETAIL:  Key (deviceid)=(159) is not present in table "device".
  </code></pre>
  
  <p>For some reason, even though I've defined the "robot" table to inherit "deivice" table, I can't reference it. Maybe I don't get object-relational database model correctly. But if you can't reference the tables so then what is the point of object-relational model?</p>