mirror of
https://github.com/postgres/postgres.git
synced 2025-10-27 00:12:01 +03:00
utility statement (DeclareCursorStmt) with a SELECT query dangling from it, rather than a SELECT query with a few unusual fields in it. Add code to determine whether a planned query can safely be run backwards. If DECLARE CURSOR specifies SCROLL, ensure that the plan can be run backwards by adding a Materialize plan node if it can't. Without SCROLL, you get an error if you try to fetch backwards from a cursor that can't handle it. (There is still some discussion about what the exact behavior should be, but this is necessary infrastructure in any case.) Along the way, make EXPLAIN DECLARE CURSOR work.
25 lines
677 B
C
25 lines
677 B
C
/*-------------------------------------------------------------------------
|
|
*
|
|
* planner.h
|
|
* prototypes for planner.c.
|
|
*
|
|
*
|
|
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
|
*
|
|
* $Id: planner.h,v 1.26 2003/03/10 03:53:52 tgl Exp $
|
|
*
|
|
*-------------------------------------------------------------------------
|
|
*/
|
|
#ifndef PLANNER_H
|
|
#define PLANNER_H
|
|
|
|
#include "nodes/parsenodes.h"
|
|
#include "nodes/plannodes.h"
|
|
|
|
|
|
extern Plan *planner(Query *parse, bool isCursor, int cursorOptions);
|
|
extern Plan *subquery_planner(Query *parse, double tuple_fraction);
|
|
|
|
#endif /* PLANNER_H */
|