Do not allow Unique nodes to be scanned backwards. The code claimed that it
authorTom Lane <[email protected]>
Tue, 5 Aug 2008 21:29:01 +0000 (21:29 +0000)
committerTom Lane <[email protected]>
Tue, 5 Aug 2008 21:29:01 +0000 (21:29 +0000)
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.

src/backend/executor/execAmi.c

index 86d09345106bb3e861c7ee27ec955c8c9e5f29f3..a0b58852c67f5b9e3b0144daa3864791b52c1673 100644 (file)
@@ -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));