diff options
| author | Tom Lane | 2005-12-28 01:30:02 +0000 |
|---|---|---|
| committer | Tom Lane | 2005-12-28 01:30:02 +0000 |
| commit | 6e07709760a29d8dbfb93b9846c905bd40689082 (patch) | |
| tree | 9bf0084587d7e313ba087ce53c24bc748c63a456 /src/pl | |
| parent | a37422e042a6114ab0e513f50dac4a47fab22313 (diff) | |
Implement SQL-compliant treatment of row comparisons for < <= > >= cases
(previously we only did = and <> correctly). Also, allow row comparisons
with any operators that are in btree opclasses, not only those with these
specific names. This gets rid of a whole lot of indefensible assumptions
about the behavior of particular operators based on their names ... though
it's still true that IN and NOT IN expand to "= ANY". The patch adds a
RowCompareExpr expression node type, and makes some changes in the
representation of ANY/ALL/ROWCOMPARE SubLinks so that they can share code
with RowCompareExpr.
I have not yet done anything about making RowCompareExpr an indexable
operator, but will look at that soon.
initdb forced due to changes in stored rules.
Diffstat (limited to 'src/pl')
| -rw-r--r-- | src/pl/plpgsql/src/pl_exec.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/pl/plpgsql/src/pl_exec.c b/src/pl/plpgsql/src/pl_exec.c index 11b0bc0eb3f..15c6085569c 100644 --- a/src/pl/plpgsql/src/pl_exec.c +++ b/src/pl/plpgsql/src/pl_exec.c @@ -3,7 +3,7 @@ * procedural language * * IDENTIFICATION - * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.157 2005/11/22 18:17:33 momjian Exp $ + * $PostgreSQL: pgsql/src/pl/plpgsql/src/pl_exec.c,v 1.158 2005/12/28 01:30:01 tgl Exp $ * * This software is copyrighted by Jan Wieck - Hamburg. * @@ -4283,6 +4283,18 @@ exec_simple_check_node(Node *node) return TRUE; } + case T_RowCompareExpr: + { + RowCompareExpr *expr = (RowCompareExpr *) node; + + if (!exec_simple_check_node((Node *) expr->largs)) + return FALSE; + if (!exec_simple_check_node((Node *) expr->rargs)) + return FALSE; + + return TRUE; + } + case T_CoalesceExpr: { CoalesceExpr *expr = (CoalesceExpr *) node; |
