diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2003-03-10 03:53:52 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2003-03-10 03:53:52 +0000 |
commit | aa83bc04e089e13f2746ba55720e5993268c46f5 (patch) | |
tree | 1b5c0082e22385789d3581792af4e1a823f835ba /src/backend/optimizer/plan/planmain.c | |
parent | b9e8ffcd5d1a3d45b2f697ea944931f56367c86b (diff) | |
download | postgresql-aa83bc04e089e13f2746ba55720e5993268c46f5.tar.gz postgresql-aa83bc04e089e13f2746ba55720e5993268c46f5.zip |
Restructure parsetree representation of DECLARE CURSOR: now it's a
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.
Diffstat (limited to 'src/backend/optimizer/plan/planmain.c')
-rw-r--r-- | src/backend/optimizer/plan/planmain.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/backend/optimizer/plan/planmain.c b/src/backend/optimizer/plan/planmain.c index daa840f789e..97f6b76a8e4 100644 --- a/src/backend/optimizer/plan/planmain.c +++ b/src/backend/optimizer/plan/planmain.c @@ -14,7 +14,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planmain.c,v 1.74 2003/01/20 18:54:52 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/optimizer/plan/planmain.c,v 1.75 2003/03/10 03:53:50 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -61,14 +61,11 @@ * indxpath.c need to see it.) * * tuple_fraction is interpreted as follows: - * 0 (or less): expect all tuples to be retrieved (normal case) + * 0: expect all tuples to be retrieved (normal case) * 0 < tuple_fraction < 1: expect the given fraction of tuples available * from the plan to be retrieved * tuple_fraction >= 1: tuple_fraction is the absolute number of tuples * expected to be retrieved (ie, a LIMIT specification) - * Note that while this routine and its subroutines treat a negative - * tuple_fraction the same as 0, grouping_planner has a different - * interpretation. *-------------------- */ void |