Re: [GENERAL] Retrieval of OO objects.

Поиск
Список
Период
Сортировка
От Oliver Elphick
Тема Re: [GENERAL] Retrieval of OO objects.
Дата
Msg-id 199904161328.OAA16627@linda.lfix.co.uk
обсуждение исходный текст
Ответ на Retrieval of OO objects.  (Chris Bitmead <chris.bitmead@bigfoot.com>)
Список 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 по дате отправления:

Предыдущее
От: Oleg Broytmann
Дата:
Сообщение: PostgreSQL WWW: Software
Следующее
От: Christopher Hutton
Дата:
Сообщение: Re: [GENERAL] Database performance