Re: [SQL] Re: [GENERAL] Proposed Changes to PostgreSQL

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: chris(at)bitmead(dot)com, "pgsql-hackers(at)postgreSQL(dot)org" <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: [SQL] Re: [GENERAL] Proposed Changes to PostgreSQL
Date: 2000-02-03 03:39:48
Message-ID: 24816.949549188@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers pgsql-sql

Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
>>>> So the field is created on the fly to show what table it came from.
>>>> Seems like a good idea, though implementing another usually-invisible
>>>> column will be tough.
>>
>> What problems do you forsee?

> Well, it is usually pretty strange to carry around a column that doesn't
> exist through all the code and finally contruct it at the end. I would
> suspect something in the rewrite system could do that pretty easily,
> though. That is the direction I would go with that.

Yeah. In fact, since the field is not required except on specific
user request (explicit SELECT, or if you like Chris' SET SHOW_CLASSNAME
idea, that'd still get translated into a SELECT target item at some
pretty early stage), I don't see any need for it to get added to the
HeapTupleHeader fields. That makes the implementation a *lot* cleaner
because you wouldn't need in-memory HeapTupleHeader to be different from
on-disk headers. I'm visualizing this as a parameterless function (or
maybe a new primitive expression node type) that gets evaluated during
ExecProject's construction of the output tuple for a a bottom-level
seqscan or indexscan plan node. The only trick is to persuade the
planner to push it down to the bottom level; normally anything that
isn't a Var gets evaluated at the top of the plan tree.

>>>> This bothers me. We return relational data, showing the same number of
>>>> columns and types for every query. I don't think we want to change
>>>> that, even for OO.

My thought also. If we had a *real* object orientation, then a returned
column would have an abstract data type that might correspond to an
object supertype. Of course that just pushes the problem down a level:
how does the application know what methods the returned object has?
How can it even invoke those methods --- whatever code might exist
for them would live on the server, presumably, not get shipped around
in query results.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Chris Bitmead 2000-02-03 03:41:18 Re: [SQL] Proposed Changes to PostgreSQL
Previous Message The Hermit Hacker 2000-02-03 03:38:05 Re: [HACKERS] Re: [SQL] Proposed Changes to PostgreSQL

Browse pgsql-hackers by date

  From Date Subject
Next Message Chris Bitmead 2000-02-03 03:41:18 Re: [SQL] Proposed Changes to PostgreSQL
Previous Message The Hermit Hacker 2000-02-03 03:38:05 Re: [HACKERS] Re: [SQL] Proposed Changes to PostgreSQL

Browse pgsql-sql by date

  From Date Subject
Next Message Chris Bitmead 2000-02-03 03:41:18 Re: [SQL] Proposed Changes to PostgreSQL
Previous Message The Hermit Hacker 2000-02-03 03:38:05 Re: [HACKERS] Re: [SQL] Proposed Changes to PostgreSQL