From a191a169d6d0b9558da4519e66510c4540204a51 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 10 Jan 2007 18:06:05 +0000 Subject: Change the planner-to-executor API so that the planner tells the executor which comparison operators to use for plan nodes involving tuple comparison (Agg, Group, Unique, SetOp). Formerly the executor looked up the default equality operator for the datatype, which was really pretty shaky, since it's possible that the data being fed to the node is sorted according to some nondefault operator class that could have an incompatible idea of equality. The planner knows what it has sorted by and therefore can provide the right equality operator to use. Also, this change moves a couple of catalog lookups out of the executor and into the planner, which should help startup time for pre-planned queries by some small amount. Modify the planner to remove some other cavalier assumptions about always being able to use the default operators. Also add "nulls first/last" info to the Plan node for a mergejoin --- neither the executor nor the planner can cope yet, but at least the API is in place. --- src/backend/parser/parse_clause.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/backend/parser/parse_clause.c') diff --git a/src/backend/parser/parse_clause.c b/src/backend/parser/parse_clause.c index 6db3fce8377..9792671fec6 100644 --- a/src/backend/parser/parse_clause.c +++ b/src/backend/parser/parse_clause.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/parser/parse_clause.c,v 1.162 2007/01/09 02:14:14 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/parser/parse_clause.c,v 1.163 2007/01/10 18:06:04 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -1676,7 +1676,8 @@ addTargetToSortList(ParseState *pstate, TargetEntry *tle, * Verify it's a valid ordering operator, and determine * whether to consider it like ASC or DESC. */ - if (!get_op_compare_function(sortop, &cmpfunc, &reverse)) + if (!get_compare_function_for_ordering_op(sortop, + &cmpfunc, &reverse)) ereport(ERROR, (errcode(ERRCODE_WRONG_OBJECT_TYPE), errmsg("operator %s is not a valid ordering operator", -- cgit v1.2.3