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

Commite274325

Browse files
committed
Fix incorrect description of rowtype variable declarations. Eventually
(IMHO) the code should be fixed to do what the documentation formerlyclaimed, and then revert this change.
1 parent4764ae8 commite274325

File tree

1 file changed

+23
-9
lines changed

1 file changed

+23
-9
lines changed

‎doc/src/sgml/plsql.sgml

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/plsql.sgml,v 2.51 2001/11/28 04:18:46 tgl Exp $
2+
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/plsql.sgml,v 2.52 2002/01/02 00:41:26 tgl Exp $
33
-->
44

55
<chapter id="plpgsql">
@@ -457,20 +457,27 @@ END;
457457

458458
<para>
459459
<synopsis>
460-
<replaceable>name</replaceable> <replaceable>table-datatype</replaceable>;
460+
<replaceable>name</replaceable> <replaceable>tablename</replaceable><literal>%ROWTYPE</literal>;
461461
</synopsis>
462462
</para>
463463

464464
<para>
465-
A variabledeclared witha composite type(referenced by the name of
466-
the table that defines that type) is called a<firstterm>row</>
467-
variable. Such a variable can hold awhole row of a SELECT or FOR
465+
A variableofa composite typeis called a <firstterm>row</>
466+
variable (or <firstterm>rowtype</> variable). Such avariable can hold a
467+
whole row of a SELECT or FOR
468468
query result, so long as that query's column set matches the declared
469-
rowtype of the variable. The individual fields of the row value are
469+
type of the variable. The individual fields of the row value are
470470
accessed using the usual dot notation, for example
471471
<literal>rowvar.field</literal>.
472472
</para>
473473

474+
<para>
475+
Presently, a row variable can only be declared using the
476+
<literal>%ROWTYPE</literal> notation; although one might expect a
477+
bare table name to work as a type declaration, it won't be accepted
478+
within <application>PL/pgSQL</application> functions.
479+
</para>
480+
474481
<para>
475482
Parameters to a function can be
476483
composite types (complete table rows). In that case, the
@@ -563,9 +570,7 @@ user_id users.user_id%TYPE;
563570
<type>%ROWTYPE</type> provides the composite data type corresponding
564571
to a whole row of the specified table.
565572
<replaceable>table</replaceable> must be an existing
566-
table or view name of the database. A row variable declared
567-
in this way acts the same as a row variable explicitly declared using
568-
the same composite (row) datatype.
573+
table or view name of the database.
569574
</para>
570575

571576
<programlisting>
@@ -616,6 +621,15 @@ RENAME id TO user_id;
616621
RENAME this_var TO that_var;
617622
</programlisting>
618623
</para>
624+
625+
<note>
626+
<para>
627+
RENAME appears to be broken as of PostgreSQL 7.2. Fixing this is
628+
of low priority, since ALIAS covers most of the practical uses of
629+
RENAME.
630+
</para>
631+
</note>
632+
619633
</sect2>
620634
</sect1>
621635

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp