From f68e11f373de8b7b1d19203b8edac1a13a8d406d Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Mon, 15 Nov 1999 02:00:15 +0000 Subject: 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. --- src/include/nodes/plannodes.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/include/nodes/plannodes.h') diff --git a/src/include/nodes/plannodes.h b/src/include/nodes/plannodes.h index a03dacfb02..e4dc5fde21 100644 --- a/src/include/nodes/plannodes.h +++ b/src/include/nodes/plannodes.h @@ -6,7 +6,7 @@ * * Copyright (c) 1994, Regents of the University of California * - * $Id: plannodes.h,v 1.31 1999/10/17 22:15:07 tgl Exp $ + * $Id: plannodes.h,v 1.32 1999/11/15 02:00:13 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -356,8 +356,8 @@ typedef struct SubPlan List *setParam; /* non-correlated EXPR & EXISTS subqueries * have to set some Params for paren Plan */ List *parParam; /* indices of corr. Vars from parent plan */ - SubLink *sublink; /* SubLink node for subselects in WHERE - * and HAVING */ + SubLink *sublink; /* SubLink node from parser; holds info about + * what to do with subselect's results */ bool shutdown; /* shutdown plan if TRUE */ } SubPlan; -- cgit v1.2.1