66 * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
77 * Portions Copyright (c) 1994, Regents of the University of California
88 *
9- *$Id: execAmi.c,v 1.64 2002/06/20 20:29:27 momjian Exp $
9+ *$Id: execAmi.c,v 1.65 2002/11/30 05:21:01 tgl Exp $
1010 *
1111 *-------------------------------------------------------------------------
1212 */
@@ -170,14 +170,10 @@ ExecReScan(Plan *node, ExprContext *exprCtxt, Plan *parent)
170170}
171171}
172172
173- /* ----------------------------------------------------------------
174- *ExecMarkPos
175- *
176- *Marks the current scan position.
173+ /*
174+ * ExecMarkPos
177175 *
178- *XXX Needs to be extended to include all the node types,
179- *or at least all the ones that can be directly below a mergejoin.
180- * ----------------------------------------------------------------
176+ * Marks the current scan position.
181177 */
182178void
183179ExecMarkPos (Plan * node )
@@ -192,6 +188,10 @@ ExecMarkPos(Plan *node)
192188ExecIndexMarkPos ((IndexScan * )node );
193189break ;
194190
191+ case T_TidScan :
192+ ExecTidMarkPos ((TidScan * )node );
193+ break ;
194+
195195case T_FunctionScan :
196196ExecFunctionMarkPos ((FunctionScan * )node );
197197break ;
@@ -204,10 +204,6 @@ ExecMarkPos(Plan *node)
204204ExecSortMarkPos ((Sort * )node );
205205break ;
206206
207- case T_TidScan :
208- ExecTidMarkPos ((TidScan * )node );
209- break ;
210-
211207default :
212208/* don't make hard error unless caller asks to restore... */
213209elog (LOG ,"ExecMarkPos: node type %d not supported" ,
@@ -216,14 +212,10 @@ ExecMarkPos(Plan *node)
216212}
217213}
218214
219- /* ----------------------------------------------------------------
220- *ExecRestrPos
221- *
222- *restores the scan position previously saved with ExecMarkPos()
215+ /*
216+ * ExecRestrPos
223217 *
224- *XXX Needs to be extended to include all the node types,
225- *or at least all the ones that can be directly below a mergejoin.
226- * ----------------------------------------------------------------
218+ * restores the scan position previously saved with ExecMarkPos()
227219 */
228220void
229221ExecRestrPos (Plan * node )
@@ -238,6 +230,10 @@ ExecRestrPos(Plan *node)
238230ExecIndexRestrPos ((IndexScan * )node );
239231break ;
240232
233+ case T_TidScan :
234+ ExecTidRestrPos ((TidScan * )node );
235+ break ;
236+
241237case T_FunctionScan :
242238ExecFunctionRestrPos ((FunctionScan * )node );
243239break ;
@@ -256,3 +252,29 @@ ExecRestrPos(Plan *node)
256252break ;
257253}
258254}
255+
256+ /*
257+ * ExecSupportsMarkRestore - does a plan type support mark/restore?
258+ *
259+ * XXX Ideally, all plan node types would support mark/restore, and this
260+ * wouldn't be needed. For now, this had better match the routines above.
261+ */
262+ bool
263+ ExecSupportsMarkRestore (NodeTag plantype )
264+ {
265+ switch (plantype )
266+ {
267+ case T_SeqScan :
268+ case T_IndexScan :
269+ case T_TidScan :
270+ case T_FunctionScan :
271+ case T_Material :
272+ case T_Sort :
273+ return true;
274+
275+ default :
276+ break ;
277+ }
278+
279+ return false;
280+ }