Add a new column to pg_am to specify whether an index AM supports backward
scanning; GiST and GIN do not, and it seems like too much trouble to make them do so. By teaching ExecSupportsBackwardScan() about this restriction, we ensure that the planner will protect a scroll cursor from the problem by adding a Materialize node. In passing, fix another longstanding bug in the same area: backwards scan of a plan with set-returning functions in the targetlist did not work either, since the TupFromTlist expansion code pays no attention to direction (and has no way to run a SRF backwards anyway). Again the fix is to make ExecSupportsBackwardScan check this restriction. Also adjust the index AM API specification to note that mark/restore support is unnecessary if the AM can't produce ordered output.
Showing
- doc/src/sgml/catalogs.sgml 8 additions, 1 deletiondoc/src/sgml/catalogs.sgml
- doc/src/sgml/indexam.sgml 12 additions, 7 deletionsdoc/src/sgml/indexam.sgml
- src/backend/executor/execAmi.c 68 additions, 5 deletionssrc/backend/executor/execAmi.c
- src/include/catalog/catversion.h 2 additions, 2 deletionssrc/include/catalog/catversion.h
- src/include/catalog/pg_am.h 29 additions, 27 deletionssrc/include/catalog/pg_am.h
Loading
Please register or sign in to comment