aboutsummaryrefslogtreecommitdiff
path: root/src/backend/nodes/copyfuncs.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2003-01-09 20:50:53 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2003-01-09 20:50:53 +0000
commit6bc61fc046961cfc2b3901ab38ac74b45f8c6cd3 (patch)
treea29a0825d52ba55e9971b8df6c4a530cc90a5bff /src/backend/nodes/copyfuncs.c
parent59779c81ba9e6ea29cec1a59d0cfdbe76fa016ff (diff)
downloadpostgresql-6bc61fc046961cfc2b3901ab38ac74b45f8c6cd3.tar.gz
postgresql-6bc61fc046961cfc2b3901ab38ac74b45f8c6cd3.zip
Adjust parser so that 'x NOT IN (subselect)' is converted to
'NOT (x IN (subselect))', that is 'NOT (x = ANY (subselect))', rather than 'x <> ALL (subselect)' as we formerly did. This opens the door to optimizing NOT IN the same way as IN, whereas there's no hope of optimizing the expression using <>. Also, convert 'x <> ALL (subselect)' to the NOT(IN) style, so that the optimization will be available when processing rules dumped by older Postgres versions. initdb forced due to small change in SubLink node representation.
Diffstat (limited to 'src/backend/nodes/copyfuncs.c')
-rw-r--r--src/backend/nodes/copyfuncs.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/backend/nodes/copyfuncs.c b/src/backend/nodes/copyfuncs.c
index c3abcfc9e80..4b326b75224 100644
--- a/src/backend/nodes/copyfuncs.c
+++ b/src/backend/nodes/copyfuncs.c
@@ -15,7 +15,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.233 2002/12/14 00:17:50 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.234 2003/01/09 20:50:50 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -809,7 +809,8 @@ _copySubLink(SubLink *from)
SubLink *newnode = makeNode(SubLink);
COPY_SCALAR_FIELD(subLinkType);
- COPY_SCALAR_FIELD(useor);
+ COPY_SCALAR_FIELD(operIsEquals);
+ COPY_SCALAR_FIELD(useOr);
COPY_NODE_FIELD(lefthand);
COPY_NODE_FIELD(oper);
COPY_NODE_FIELD(subselect);
@@ -826,7 +827,7 @@ _copySubPlan(SubPlan *from)
SubPlan *newnode = makeNode(SubPlan);
COPY_SCALAR_FIELD(subLinkType);
- COPY_SCALAR_FIELD(useor);
+ COPY_SCALAR_FIELD(useOr);
COPY_NODE_FIELD(oper);
COPY_NODE_FIELD(plan);
COPY_SCALAR_FIELD(plan_id);