Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 12bc87e

Browse files
committed
Refine the use of terminology around bound and unbound cursors and cursor
variables. Remove the confusing term "reference cursor".
1 parent efa8544 commit 12bc87e

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

doc/src/sgml/plpgsql.sgml

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/plpgsql.sgml,v 1.141 2009/05/02 17:27:57 tgl Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/plpgsql.sgml,v 1.142 2009/06/18 10:22:08 petere Exp $ -->
22

33
<chapter id="plpgsql">
44
<title><application>PL/pgSQL</application> - <acronym>SQL</acronym> Procedural Language</title>
@@ -2450,7 +2450,7 @@ DECLARE
24502450

24512451
<note>
24522452
<para>
2453-
Bound cursors can also be used without explicitly opening them,
2453+
Bound cursor variables can also be used without explicitly opening the cursor,
24542454
via the <command>FOR</> statement described in
24552455
<xref linkend="plpgsql-cursor-for-loop">.
24562456
</para>
@@ -2460,13 +2460,13 @@ DECLARE
24602460
<title><command>OPEN FOR</command> <replaceable>query</replaceable></title>
24612461

24622462
<synopsis>
2463-
OPEN <replaceable>unbound_cursor</replaceable> <optional> <optional> NO </optional> SCROLL </optional> FOR <replaceable>query</replaceable>;
2463+
OPEN <replaceable>unbound_cursorvar</replaceable> <optional> <optional> NO </optional> SCROLL </optional> FOR <replaceable>query</replaceable>;
24642464
</synopsis>
24652465

24662466
<para>
24672467
The cursor variable is opened and given the specified query to
24682468
execute. The cursor cannot be open already, and it must have been
2469-
declared as an unbound cursor (that is, as a simple
2469+
declared as an unbound cursor variable (that is, as a simple
24702470
<type>refcursor</> variable). The query must be a
24712471
<command>SELECT</command>, or something else that returns rows
24722472
(such as <command>EXPLAIN</>). The query
@@ -2494,13 +2494,13 @@ OPEN curs1 FOR SELECT * FROM foo WHERE key = mykey;
24942494
<title><command>OPEN FOR EXECUTE</command></title>
24952495

24962496
<synopsis>
2497-
OPEN <replaceable>unbound_cursor</replaceable> <optional> <optional> NO </optional> SCROLL </optional> FOR EXECUTE <replaceable class="command">query_string</replaceable>;
2497+
OPEN <replaceable>unbound_cursorvar</replaceable> <optional> <optional> NO </optional> SCROLL </optional> FOR EXECUTE <replaceable class="command">query_string</replaceable>;
24982498
</synopsis>
24992499

25002500
<para>
25012501
The cursor variable is opened and given the specified query to
25022502
execute. The cursor cannot be open already, and it must have been
2503-
declared as an unbound cursor (that is, as a simple
2503+
declared as an unbound cursor variable (that is, as a simple
25042504
<type>refcursor</> variable). The query is specified as a string
25052505
expression, in the same way as in the <command>EXECUTE</command>
25062506
command. As usual, this gives flexibility so the query plan can vary
@@ -2524,7 +2524,7 @@ OPEN curs1 FOR EXECUTE 'SELECT * FROM ' || quote_ident($1);
25242524
<title>Opening a Bound Cursor</title>
25252525

25262526
<synopsis>
2527-
OPEN <replaceable>bound_cursor</replaceable> <optional> ( <replaceable>argument_values</replaceable> ) </optional>;
2527+
OPEN <replaceable>bound_cursorvar</replaceable> <optional> ( <replaceable>argument_values</replaceable> ) </optional>;
25282528
</synopsis>
25292529

25302530
<para>
@@ -2850,7 +2850,7 @@ COMMIT;
28502850

28512851
<synopsis>
28522852
<optional> &lt;&lt;<replaceable>label</replaceable>&gt;&gt; </optional>
2853-
FOR <replaceable>recordvar</replaceable> IN <replaceable>bound_cursor</replaceable> <optional> ( <replaceable>argument_values</replaceable> ) </optional> LOOP
2853+
FOR <replaceable>recordvar</replaceable> IN <replaceable>bound_cursorvar</replaceable> <optional> ( <replaceable>argument_values</replaceable> ) </optional> LOOP
28542854
<replaceable>statements</replaceable>
28552855
END LOOP <optional> <replaceable>label</replaceable> </optional>;
28562856
</synopsis>

src/include/catalog/pg_type.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
99
* Portions Copyright (c) 1994, Regents of the University of California
1010
*
11-
* $PostgreSQL: pgsql/src/include/catalog/pg_type.h,v 1.205 2009/06/11 14:49:10 momjian Exp $
11+
* $PostgreSQL: pgsql/src/include/catalog/pg_type.h,v 1.206 2009/06/18 10:22:09 petere Exp $
1212
*
1313
* NOTES
1414
* the genbki.sh script reads this file and generates .bki
@@ -520,7 +520,7 @@ DESCR("numeric(precision, decimal), arbitrary precision number");
520520
#define NUMERICOID 1700
521521

522522
DATA(insert OID = 1790 ( refcursor PGNSP PGUID -1 f b U f t \054 0 0 2201 textin textout textrecv textsend - - - i x f 0 -1 0 _null_ _null_ ));
523-
DESCR("reference cursor (portal name)");
523+
DESCR("reference to cursor (portal name)");
524524
#define REFCURSOROID 1790
525525

526526
/* OIDS 2200 - 2299 */

src/pl/plpgsql/src/gram.y

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $PostgreSQL: pgsql/src/pl/plpgsql/src/gram.y,v 1.124 2009/05/01 23:57:34 tgl Exp $
12+
* $PostgreSQL: pgsql/src/pl/plpgsql/src/gram.y,v 1.125 2009/06/18 10:22:09 petere Exp $
1313
*
1414
*-------------------------------------------------------------------------
1515
*/
@@ -1585,7 +1585,7 @@ stmt_open : K_OPEN lno cursor_variable
15851585
(errcode(ERRCODE_SYNTAX_ERROR),
15861586
errmsg("syntax error at \"%s\"",
15871587
yytext),
1588-
errdetail("Expected \"FOR\", to open a reference cursor.")));
1588+
errdetail("Expected \"FOR\", to open a cursor for an unbound cursor variable.")));
15891589
}
15901590

15911591
tok = yylex();

0 commit comments

Comments
 (0)