]> granicus.if.org Git - postgresql/commit
Implement subselects in target lists. Also, relax requirement that
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 15 Nov 1999 02:00:15 +0000 (02:00 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 15 Nov 1999 02:00:15 +0000 (02:00 +0000)
commitf68e11f373de8b7b1d19203b8edac1a13a8d406d
treec4e61de2b9bd9b8dd7c70545dc861de3547294d4
parent1ecb129d206f30f5813b01e1f1efe75c06febe49
Implement subselects in target lists.  Also, relax requirement that
subselects can only appear on the righthand side of a binary operator.
That's still true for quantified predicates like x = ANY (SELECT ...),
but a subselect that delivers a single result can now appear anywhere
in an expression.  This is implemented by changing EXPR_SUBLINK sublinks
to represent just the (SELECT ...) expression, without any 'left hand
side' or combining operator --- so they're now more like EXISTS_SUBLINK.
To handle the case of '(x, y, z) = (SELECT ...)', I added a new sublink
type MULTIEXPR_SUBLINK, which acts just like EXPR_SUBLINK used to.
But the grammar will only generate one for a multiple-left-hand-side
row expression.
12 files changed:
src/backend/executor/nodeSubplan.c
src/backend/nodes/copyfuncs.c
src/backend/optimizer/plan/planmain.c
src/backend/optimizer/plan/planner.c
src/backend/optimizer/plan/subselect.c
src/backend/parser/analyze.c
src/backend/parser/gram.y
src/backend/parser/parse_expr.c
src/backend/rewrite/rewriteHandler.c
src/backend/utils/adt/ruleutils.c
src/include/nodes/plannodes.h
src/include/nodes/primnodes.h