diff options
author | Bruce Momjian <bruce@momjian.us> | 2002-07-18 04:41:46 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2002-07-18 04:41:46 +0000 |
commit | 3e22406ec63b60ed50d3d0c593f9e84b5e1d058b (patch) | |
tree | 9cd544d8f473a766e21629227f615bd536d0359d /src/backend/utils/adt/ruleutils.c | |
parent | 7ea5f1d7f16e9771e90c020db93d7e8a9a3b22f5 (diff) | |
download | postgresql-3e22406ec63b60ed50d3d0c593f9e84b5e1d058b.tar.gz postgresql-3e22406ec63b60ed50d3d0c593f9e84b5e1d058b.zip |
Finished the Between patch Christopher started.
Implements between (symmetric / asymmetric) as a node.
Executes the left or right expression once, makes a Const out of the
resulting Datum and executes the >=, <= portions out of the Const sets.
Of course, the parser does a fair amount of preparatory work for this to
happen.
Rod Taylor
Diffstat (limited to 'src/backend/utils/adt/ruleutils.c')
-rw-r--r-- | src/backend/utils/adt/ruleutils.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c index bcdfe313b6b..f99ef53603d 100644 --- a/src/backend/utils/adt/ruleutils.c +++ b/src/backend/utils/adt/ruleutils.c @@ -3,7 +3,7 @@ * back to source text * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.109 2002/07/04 15:24:07 thomas Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/ruleutils.c,v 1.110 2002/07/18 04:41:45 momjian Exp $ * * This software is copyrighted by Jan Wieck - Hamburg. * @@ -1879,7 +1879,32 @@ get_rule_expr(Node *node, deparse_context *context) } } break; + case T_BetweenExpr: + { + BetweenExpr *btwn = (BetweenExpr *) node; + + get_rule_expr(btwn->expr, context); + + if (btwn->not) + appendStringInfo(buf, " NOT"); + appendStringInfo(buf, " BETWEEN"); + + /* + * Output both symmetric and asymmetric, even though + * asymmetric is default + */ + if (btwn->symmetric) + appendStringInfo(buf, " SYMMETRIC "); + else + appendStringInfo(buf, " ASYMMETRIC "); + + get_rule_expr(btwn->lexpr, context); + + appendStringInfo(buf, " AND "); + get_rule_expr(btwn->rexpr, context); + } + break; default: elog(ERROR, "get_rule_expr: unknown node type %d", nodeTag(node)); break; |