From: Tom Lane Date: Tue, 5 Aug 2008 21:29:01 +0000 (+0000) Subject: Do not allow Unique nodes to be scanned backwards. The code claimed that it X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=e35b7b62ec886b66aaef9fa4819b5aee9c8b25ed;p=users%2Fbernd%2Fpostgres.git Do not allow Unique nodes to be scanned backwards. The code claimed that it would work, but in fact it didn't return the same rows when moving backwards as when moving forwards. This would have no visible effect in a DISTINCT query (at least assuming the column datatypes use a strong definition of equality), but it gave entirely wrong answers for DISTINCT ON queries. --- diff --git a/src/backend/executor/execAmi.c b/src/backend/executor/execAmi.c index 86d0934510..a0b58852c6 100644 --- a/src/backend/executor/execAmi.c +++ b/src/backend/executor/execAmi.c @@ -338,9 +338,6 @@ ExecSupportsBackwardScan(Plan *node) case T_Sort: return true; - case T_Unique: - return ExecSupportsBackwardScan(outerPlan(node)); - case T_Limit: return ExecSupportsBackwardScan(outerPlan(node));