From 3e22406ec63b60ed50d3d0c593f9e84b5e1d058b Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Thu, 18 Jul 2002 04:41:46 +0000 Subject: 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 --- src/backend/utils/adt/ruleutils.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'src/backend/utils/adt/ruleutils.c') 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; -- cgit v1.2.3