Hi hackers!
Experimenting with the new pluggable storage API, I found that amcanbackward
flag is not checked in build_index_paths() before
build_index_pathkeys(... BackwardScanDirection) call when we are building
paths for ORDER BY. And this flag is even not copied into IndexOptInfo struct.
Obviously, this can lead to misuse of Backward Index [Only] Scan plans.
Attached patch with the corresponding fix.
There are no test cases because now only btree supports ordered scans but it
supports backward scans too.
--
Nikita Glukhov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company