type of result column after heterogeneous join

From: Marshall Spight <mspight_at_dnai.com>
Date: Sun, 31 Aug 2003 16:40:53 GMT
Message-ID: <pyp4b.315439$Ho3.44679_at_sccrnsc03>



Hi all,

Suppose there exists a relational database that supports a type system that includes union types. (For example,
(int|string), "an int or a string" is a valid type.) Now
suppose one had two tables, the first with one column named "a" of type int, the second with one column named "a" of type string. Table 1 has exactly one row, and that row has a=1. Table 2 has exacly one row, and that row has a="hello".

What should be the result of a join/union of the two tables?
(Join and union are the same in this example.) Specifically,
what is the column type of the resulting relation?

  1. None; this causes a type error
  2. (int|string)
  3. Most specific supertype of int and string. (Possibly 'alpha'.)
  4. alpha, the maximal supertype.

Of the choices, 2 and 3 seem the best, but I am unable to come up wit a basis for choosing among the choices. Alternatively, I could imagine making the choice between 2 and 3 (or even 1) an option somehow.

Your thoughts, please?

Marshall Received on Sun Aug 31 2003 - 18:40:53 CEST

Original text of this message