Re: [GENERAL] Retrieval of OO objects. - Mailing list pgsql-general

From Oliver Elphick
Subject Re: [GENERAL] Retrieval of OO objects.
Date
Msg-id 199904161328.OAA16627@linda.lfix.co.uk
Whole thread Raw
In response to Retrieval of OO objects.  (Chris Bitmead <chris.bitmead@bigfoot.com>)
List pgsql-general
Chris Bitmead wrote:
  >Is it possible in postgres to retrieve objects with differing fields,
  >like in an object database? Like if I have
  >
  >CREATE TABLE aaa ( a text );
  >
  >CREATE TABLE bbb ( b text ) inherits (aaa);
  >
  >CREATE TABLE ccc ( c text ) inherits (aaa);
  >
  >SELECT * from aaa*;
  >
  >Is it possible to get the fields a and c returned on objects of type bbb
  >and ccc? This is what an object database would do automatically.

No; your query on aaa* will return only field a, although it will include
all rows from aaa, bbb and ccc.

This is in line with standard OO treatment of inherited classes.
Class aaa only has a single feature, a; it knows nothing about additional
features of descendant classes.



--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
               PGP key from public servers; key ID 32B8FAA1
                 ========================================
     "But seek ye first the kingdom of God, and his
      righteousness; and all these things shall be added
      unto you."     Matthew 6:33



pgsql-general by date:

Previous
From: Oleg Broytmann
Date:
Subject: PostgreSQL WWW: Software
Next
From: Christopher Hutton
Date:
Subject: Re: [GENERAL] Database performance