aboutsummaryrefslogtreecommitdiff
path: root/src/backend/nodes/outfuncs.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/outfuncs.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/outfuncs.c')
-rw-r--r--src/backend/nodes/outfuncs.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/backend/nodes/outfuncs.c b/src/backend/nodes/outfuncs.c
index 97fc9462a27..204c00ad674 100644
--- a/src/backend/nodes/outfuncs.c
+++ b/src/backend/nodes/outfuncs.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.190 2002/12/14 00:17:52 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.191 2003/01/09 20:50:50 tgl Exp $
*
* NOTES
* Every node type that can appear in stored rules' parsetrees *must*
@@ -658,7 +658,8 @@ _outSubLink(StringInfo str, SubLink *node)
WRITE_NODE_TYPE("SUBLINK");
WRITE_ENUM_FIELD(subLinkType, SubLinkType);
- WRITE_BOOL_FIELD(useor);
+ WRITE_BOOL_FIELD(operIsEquals);
+ WRITE_BOOL_FIELD(useOr);
WRITE_NODE_FIELD(lefthand);
WRITE_NODE_FIELD(oper);
WRITE_NODE_FIELD(subselect);
@@ -670,7 +671,7 @@ _outSubPlan(StringInfo str, SubPlan *node)
WRITE_NODE_TYPE("SUBPLAN");
WRITE_ENUM_FIELD(subLinkType, SubLinkType);
- WRITE_BOOL_FIELD(useor);
+ WRITE_BOOL_FIELD(useOr);
WRITE_NODE_FIELD(oper);
WRITE_NODE_FIELD(plan);
WRITE_INT_FIELD(plan_id);