Re: OIDS (Re: [HACKERS] Well, then you keep your darn columns)

Поиск
Список
Период
Сортировка
От Chris Bitmead
Тема Re: OIDS (Re: [HACKERS] Well, then you keep your darn columns)
Дата
Msg-id 3890DDE0.6FE73291@bitmead.com
обсуждение исходный текст
Ответ на OIDS (Re: [HACKERS] Well, then you keep your darn columns)  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: OIDS (Re: [HACKERS] Well, then you keep your darn columns)  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-hackers
Hannu Krosing wrote:

> > You are saying that you used to be able to get full tuples from postgres
> > if you selected from base* ??? In other words I select * from base, and
> > I can get back the fields in an inherited class too?
> >
> > I have followed postgres from way back before the 'net started hacking
> > on it, and I've never come across this (but I desperately want it).
> 
> Here is how I remember it:
> 
> At least the wire protocol supports it and also libpq used to support it,
> until at about time of postgres95/postgreSQL it was removed from libpq as
> "unneeded" (by Bruce IIRC).

Bruce, you scoundrel! :-)

> until that time it should have theoretically been possible to return tuples
> of several types and sizes, either by using "select * from base* " or unions
> or functions in backend.

I wonder how this would have worked. How would the backend know if you
wanted the 
sub-class columns or just the table? Did psql ever print different types
in the one
table? At least the current PQ interface doesn't seem to have this in
mind
since the interface seems to assume every tuple will have the same
number
of columns.

How much of this logic has been destroyed in the back end I wonder?

> For example inheritance is used my some as a convienient means of creating
> tables with some shared column names/types and adding anything to make it
> more has met vocal resiostance on this net as being incompatible with current
> usage.

Hmm. Damned useful though. Every time I design a data model, I feel
myself
yearning for this feature. In fact I can see precious little point in
having
an ORDBMS without this feature.

> > SELECT ** FROM object WHERE oid = 12345;
> >
> We could define object as a relation with no attributes (columns) that all
> other
> inherits from, so
> 
> SELECT ** FROM object* WHERE oid = 12345;
> 
> would be valid query for getting all objects with oid=12345;
> 
> actually there could be more than one currently as you can input new ones by
> doing a "load from ..."
> 
> My suggestion for using * for all tables would imply a relation called ""
> (i.e. empty string) as the universal base.

Interesting thought.

> Some systems use a keyword ALL .
> 
> ---------------
> Hannu


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Chris Bitmead
Дата:
Сообщение: Re: OIDS (Re: [HACKERS] Well, then you keep your darn columns)
Следующее
От: Chris Bitmead
Дата:
Сообщение: Re: [HACKERS] Inheritance, referential integrity and other constraints