AW: UNIONS - Mailing list pgsql-hackers

From Zeugswetter Andreas SB
Subject AW: UNIONS
Date
Msg-id 11C1E6749A55D411A9670001FA687963368045@sdexcsrv1.f000.d0188.sd.spardat.at
Whole thread Raw
Responses Re: AW: UNIONS  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> > select id, null as text from foo union select id, name from 
> foo_child;
> > fails with
> > unable to trasform {insert whatever type here} into unknown
> >          Each UNION | EXCEPT | INTERSECT clause must have 
> compatible target 
> > types
> 
> The UNION type-resolution code could use some work; right now I think
> the algorithm is to use the types of the first SELECT and force
> everything else into that.

Imho this is expected behavior (maybe even standard). Very easy to
understand.
> A more symmetrical
> promote-to-common-supertype approach would be nice.

While this sounds sexy it is not what people would expect (imho),
and would have a magic touch to it.

Andreas


pgsql-hackers by date:

Previous
From: "Hiroshi Inoue"
Date:
Subject: RE: Re: LIKE gripes
Next
From: Kovacs Zoltan Sandor
Date:
Subject: ACL inheritance for sequences