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

From: Hannu Krosing <hannu(at)tm(dot)ee>
To: Chris Bitmead <chris(at)bitmead(dot)com>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, The Hermit Hacker <scrappy(at)hub(dot)org>, Adriaan Joubert <a(dot)joubert(at)albourne(dot)com>, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: OIDS (Re: [HACKERS] Well, then you keep your darn columns)
Date: 2000-01-27 10:09:55
Message-ID: 38901973.49CA09C6@tm.ee
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Chris Bitmead wrote:
>
> Hannu Krosing wrote:
>
> > select * from relation_containing_oid(myoid) where oid = myoid;
> > maybe spelled as
> > select * from * where oid = myoid; ;)
> >
> > An we could re-introduce the ability to get full tuples for select * from
> > base*;
> >
> > We used to have it but cuurently it is at lest discouraged and probably
> > unsupported
> > in libpq;
>
> 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).

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.

PostgreSQLs moving to SQL92 has dropped most of OO features as non-compliant
;(

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.

> BTW, I think the relation_containing_oid logically belongs in the WHERE
> clause. Then you need some syntax for specifying to get all the fields
> from subclasses too. If you have no idea the type of object then you
> have some logical "Object" relation which is the logical parent of all
> relations. Suggesting the syntax "**" for meaning all columns including
> sub-columns, I have suggested...
>
> 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.

Some systems use a keyword ALL .

---------------
Hannu

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hannu Krosing 2000-01-27 10:27:05 Re: OIDS (Re: [HACKERS] Well, then you keep your darn columns)
Previous Message Zeugswetter Andreas SB 2000-01-27 09:55:10 AW: AW: AW: AW: [HACKERS] Some notes on optimizer cost estimates