In 6.5.3, it seems that UNION is not allowed inside a sub-select:

bray=> select p.id, p.name, a.town from person* as p, address as a
bray=> where p.id in
bray-> (select id from customer union select id from supplier);
ERROR:  parser: parse error at or near "union"

The same applies to EXCEPT and INTERSECT.

Is this a permanent feature, an oversight, or something already on the TODO
list?


-- 
      Vote against SPAM: http://www.politik-digital.de/spam/
                 ========================================
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight                              http://www.lfix.co.uk/oliver
               PGP key from public servers; key ID 32B8FAA1
                 ========================================
     "The earth is the LORD'S, and the fullness thereof; the
      world, and they that dwell therein."       Psalms 24:1



Sun, 28 Nov 1999 19:50:55 +0000
"Oliver Elphick" <olly@lfix.co.uk>
UNION not allowed in sub-selects?
"Oliver Elphick" <olly@lfix.co.uk> writes:
> In 6.5.3, it seems that UNION is not allowed inside a sub-select:
> Is this a permanent feature, an oversight, or something already on the TODO
> list?

The latter, as a moment's investigation would have shown you:

* Support UNION/INTERSECT/EXCEPT in sub-selects

Changing the grammar to allow it would be the work of a moment,
but the rewriter and other stages need more work.  I've been putting
it off until we do the much-discussed, little-implemented querytree
representation redesign.  It might be possible to fix this within the
current representation, but Except_Intersect_Rewrite() is so
ugly/grotty/broken that I don't really want to touch it until I can
discard it and rewrite from the ground up...

			regards, tom lane

Sun, 28 Nov 1999 17:43:57 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: [HACKERS] UNION not allowed in sub-selects? 

This is already on TODO list.

> In 6.5.3, it seems that UNION is not allowed inside a sub-select:
> 
> bray=> select p.id, p.name, a.town from person* as p, address as a
> bray=> where p.id in
> bray-> (select id from customer union select id from supplier);
> ERROR:  parser: parse error at or near "union"
> 
> The same applies to EXCEPT and INTERSECT.
> 
> Is this a permanent feature, an oversight, or something already on the TODO
> list?
> 
> 
> -- 
>       Vote against SPAM: http://www.politik-digital.de/spam/
>                  ========================================
> Oliver Elphick                                Oliver.Elphick@lfix.co.uk
> Isle of Wight                              http://www.lfix.co.uk/oliver
>                PGP key from public servers; key ID 32B8FAA1
>                  ========================================
>      "The earth is the LORD'S, and the fullness thereof; the
>       world, and they that dwell therein."       Psalms 24:1
> 
> 
> 
> ************
> 


-- 
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Mon, 29 Nov 1999 22:54:37 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: [HACKERS] UNION not allowed in sub-selects?