EXPLAIN-only operation was a little too short; it skipped initializing the
node's result tuple type, which may be needed depending on what's above the
indexscan node. Call ExecAssignResultTypeFromTL before exiting. (For good
luck I moved up the ExecAssignScanProjectionInfo call as well, so that
everything except indexscan-specific initialization will still be done.)
Per example from Grant Finnemore.
*/
ExecAssignScanType(&indexstate->ss, RelationGetDescr(currentRelation));
+ /*
+ * Initialize result tuple type and projection info.
+ */
+ ExecAssignResultTypeFromTL(&indexstate->ss.ps);
+ ExecAssignScanProjectionInfo(&indexstate->ss);
+
/*
* If we are just doing EXPLAIN (ie, aren't going to run the plan),
* stop here. This allows an index-advisor plugin to EXPLAIN a plan
indexstate->iss_NumScanKeys,
indexstate->iss_ScanKeys);
- /*
- * Initialize result tuple type and projection info.
- */
- ExecAssignResultTypeFromTL(&indexstate->ss.ps);
- ExecAssignScanProjectionInfo(&indexstate->ss);
-
/*
* all done.
*/