Обсуждение: UNION not allowed in sub-selects?

Поиск
Список
Период
Сортировка

UNION not allowed in sub-selects?

От
"Oliver Elphick"
Дата:
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
ID32B8FAA1                ========================================    "The earth is the LORD'S, and the fullness
thereof;the     world, and they that dwell therein."       Psalms 24:1
 




Re: [HACKERS] UNION not allowed in sub-selects?

От
Tom Lane
Дата:
"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


Re: [HACKERS] UNION not allowed in sub-selects?

От
Bruce Momjian
Дата:
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,
Pennsylvania19026