Allow CustomScan providers to say whether they support projections.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 6 Jul 2021 22:10:11 +0000 (18:10 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 6 Jul 2021 22:10:20 +0000 (18:10 -0400)
commit955b3e0f9269639fb916cee3dea37aee50b82df0
tree395cf4010f26d0e3f2383f9ad724cb683135acce
parent5798ca529935698ab976780565fb2b4d8d34d810
Allow CustomScan providers to say whether they support projections.

Previously, all CustomScan providers had to support projections,
but there may be cases where this is inconvenient.  Add a flag
bit to say if it's supported.

Important item for the release notes: this is non-backwards-compatible
since the default is now to assume that CustomScan providers can't
project, instead of assuming that they can.  It's fail-soft, but could
result in visible performance penalties due to adding unnecessary
Result nodes.

Sven Klemm, reviewed by Aleksander Alekseev; some cosmetic fiddling
by me.

Discussion: https://postgr.es/m/CAMCrgp1kyakOz6c8aKhNDJXjhQ1dEjEnp+6KNT3KxPrjNtsrDg@mail.gmail.com
doc/src/sgml/custom-scan.sgml
src/backend/executor/execAmi.c
src/backend/optimizer/plan/createplan.c
src/include/nodes/extensible.h