From: Tom Lane Date: Tue, 5 Aug 2008 21:28:48 +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=29e818d7cc99c045940ce24b1ac4def597f7e2d6;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 da2791876e..b42bfc9f75 100644 --- a/src/backend/executor/execAmi.c +++ b/src/backend/executor/execAmi.c @@ -383,9 +383,6 @@ ExecSupportsBackwardScan(Plan *node) case T_Sort: return true; - case T_Unique: - return ExecSupportsBackwardScan(outerPlan(node)); - case T_Limit: return ExecSupportsBackwardScan(outerPlan(node));