1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-14 18:42:34 +03:00

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
This commit is contained in:
Bruce Momjian
2002-07-18 04:41:46 +00:00
parent 7ea5f1d7f1
commit 3e22406ec6
15 changed files with 619 additions and 35 deletions

View File

@ -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;