Re: [GENERAL] Retrieval of OO objects.

From: Chris Bitmead <chris(dot)bitmead(at)bigfoot(dot)com>
To: pgsql-general(at)postgreSQL(dot)org, pgsql-hackers(at)hub(dot)org
Subject: Re: [GENERAL] Retrieval of OO objects.
Date: 1999-04-17 09:21:13
Message-ID: 37185289.EB4EB4A1@bigfoot.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Oliver Elphick wrote:

> It would be wrong to mix these columns into one, because their meanings are
> different. If you were to `select status from person*' which column should
> be shown?

ERROR: Ambiguous column - Organization::status, Employee::status.

> You are right to say that all data should be retrievable, but wrong in
> wanting to attach descendant features to an ancestor class.

If the database were the whole world - maybe. But people use languages
to program databases. With a sort-of object database like PGSQL, an
object language would seem an obvious choice.

But there is no simple way to write a language integration interface so
that you could... say SELECT * from person* and instantiate appropriate
C++ classes complete with ancestor attributes for ancestor classes.
Maybe a new syntax would be appropriate, select ** from person*, the
"**" meaning to select all the attributes from the subclasses as well as
the specified classes.

This would then be used by a funky C++ language binding to instantiate
different C++ objects for different types of rows that come back.

> In this example, if I want a list of contacts, I must `select contact from
> organisation*', because person does not have a contact field. I lose
> nothing thereby, because there is no information to be got from any other
> sub-trees about contact.

You lose something, which is the ability to write a C++ language binding
that looks something like
Collection<Person> c = query("SELECT ** from person*);
and have any person decendants to have all their correct attributes
instantiated.

I'd love to see a project to give postgres an ODMG (Object Database
Management Group) standard interface for various languages. The guts of
postgres clearly has all the fundamentals, but a few details like this
would have to be added.

--
Chris Bitmead
http://www.bigfoot.com/~chris.bitmead
mailto:chris(dot)bitmead(at)bigfoot(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Samy Elashmawy 1999-04-17 10:33:59 subscribe end
Previous Message Oliver Elphick 1999-04-17 09:01:50 Re: [GENERAL] Retrieval of OO objects.