Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit12bc87e

Browse files
committed
Refine the use of terminology around bound and unbound cursors and cursor
variables. Remove the confusing term "reference cursor".
1 parentefa8544 commit12bc87e

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

‎doc/src/sgml/plpgsql.sgml

Lines changed: 8 additions & 8 deletions
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-
Boundcursorscan also be used without explicitly openingthem,
2453+
Boundcursor variablescan also be used without explicitly openingthe 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 cursorvariable(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 cursorvariable(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

Lines changed: 2 additions & 2 deletions
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
#defineNUMERICOID1700
521521

522522
DATA(insertOID=1790 (refcursorPGNSPPGUID-1fbUft \054002201textintextouttextrecvtextsend---ixf0-10_null__null_ ));
523-
DESCR("reference cursor (portal name)");
523+
DESCR("referencetocursor (portal name)");
524524
#defineREFCURSOROID1790
525525

526526
/* OIDS 2200 - 2299 */

‎src/pl/plpgsql/src/gram.y

Lines changed: 2 additions & 2 deletions
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 areferencecursor.")));
1588+
errdetail("Expected\"FOR\", to open acursor for an unboundcursor variable.")));
15891589
}
15901590

15911591
tok =yylex();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp