Re: bug or my ignorance ?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Robert B(dot) Easter" <reaster(at)comptechnews(dot)com>
Cc: Holger Krug <hkrug(at)rationalizer(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: bug or my ignorance ?
Date: 2001-12-11 15:46:12
Message-ID: 17198.1008085572@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Robert B. Easter" <reaster(at)comptechnews(dot)com> writes:
> Table types were intended to be used like the following example

Not really. What seems to have been implemented back in the PostQUEL
days was "set attributes", by which they meant function attributes:
what was stored in such a field was the OID of a *function*. Retrieval
would run the function, producing one or more tuples from which an
individual field could be selected.

The example you give could have been implemented by defining a function
that executes "select * from t1 where key = something" and then storing
its OID in a row of t2.

This approach had a number of problems, the main one being the confusion
between fields-that-are-function-references and values-that-are-tuples.
There wasn't any distinction made AFAICT, and thus any situation where
a tuple datatype appears as a field of a larger tuple is liable to be
misinterpreted as a function reference instead.

The whole thing strikes me as an academic toy rather than a seriously
usable feature. (Are you really going to want to define a new function
for every row of your table? How should the system know when to get rid
of such functions? Not to mention the horrid memory leaks all over the
place in the implementation.) I'd like to get rid of it and put in a
clean implementation of tuple-valued functions and fields instead.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2001-12-11 15:48:57 Re: problems doing sub-selects on PostgreSQL 7.1.3 and Solaris 7
Previous Message Holger Krug 2001-12-11 15:41:11 Re: bug or my ignorance ?