Fix typos and inconsistancies found by He Weiping

(aka Henry) <laser@zhangmai.com.cn>.
Fix new problems in insert.sgml and create_function.sgml which kept jade
 from completing.
This commit is contained in:
Thomas G. Lockhart 2000-08-25 15:17:50 +00:00
parent 8cca25728b
commit a5da56d320
6 changed files with 149 additions and 219 deletions

View File

@ -1,5 +1,5 @@
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/Attic/plsql.sgml,v 2.8 2000/05/17 00:15:48 momjian Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/Attic/plsql.sgml,v 2.9 2000/08/25 15:17:36 thomas Exp $
--> -->
<chapter> <chapter>
@ -157,7 +157,7 @@ END;
<varlistentry> <varlistentry>
<term> <term>
<replaceable>name</replaceable> [ CONSTANT ] <replaceable>name</replaceable> [ CONSTANT ]
<replaceable>type</replaceable>> [ NOT NULL ] [ DEFAULT | := <replaceable>type</replaceable> [ NOT NULL ] [ DEFAULT | :=
<replaceable>value</replaceable> ]; <replaceable>value</replaceable> ];
</term> </term>
<listitem> <listitem>

View File

@ -1,5 +1,5 @@
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/pltcl.sgml,v 2.4 2000/05/18 14:24:32 momjian Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/pltcl.sgml,v 2.5 2000/08/25 15:17:36 thomas Exp $
--> -->
<chapter> <chapter>
@ -280,7 +280,7 @@ CREATE FUNCTION trigfunc_modcount() RETURNS OPAQUE AS '
return [array get NEW] return [array get NEW]
' LANGUAGE 'pltcl'; ' LANGUAGE 'pltcl';
CREATE TABLE mytab (num int4, modcnt int4, desc text); CREATE TABLE mytab (num int4, modcnt int4, description text);
CREATE TRIGGER trig_mytab_modcount BEFORE INSERT OR UPDATE ON mytab CREATE TRIGGER trig_mytab_modcount BEFORE INSERT OR UPDATE ON mytab
FOR EACH ROW EXECUTE PROCEDURE trigfunc_modcount('modcnt'); FOR EACH ROW EXECUTE PROCEDURE trigfunc_modcount('modcnt');
@ -383,7 +383,7 @@ spi_exec -array C "SELECT * FROM pg_class" {
will print a DEBUG log message for every row of pg_class. The return value will print a DEBUG log message for every row of pg_class. The return value
of <function>spi_exec</function> is the number of rows of <function>spi_exec</function> is the number of rows
affected by query as found in affected by the query as found in
the global variable SPI_processed. the global variable SPI_processed.
</para> </para>
</listitem> </listitem>
@ -407,7 +407,7 @@ spi_exec -array C "SELECT * FROM pg_class" {
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term>spi_exec ?-count <replaceable>n</replaceable>? ?-array<replaceable>name</replaceable>? ?-nulls<replaceable>string</replaceable>? <replaceable>query</replaceable> ?<replaceable>value-list</replaceable>? ?<replaceable>loop-body</replaceable>?</term> <term>spi_exec ?-count <replaceable>n</replaceable>? ?-array<replaceable>name</replaceable>? ?-nulls<replaceable>string</replaceable>? <replaceable>queryid</replaceable> ?<replaceable>value-list</replaceable>? ?<replaceable>loop-body</replaceable>?</term>
<listitem> <listitem>
<para> <para>
Execute a prepared plan from spi_prepare with variable substitution. Execute a prepared plan from spi_prepare with variable substitution.

View File

@ -1,8 +1,8 @@
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/postgres.sgml,v 1.39 2000/07/21 00:44:13 petere Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/postgres.sgml,v 1.40 2000/08/25 15:17:37 thomas Exp $
--> -->
<!doctype book PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [ <!doctype set PUBLIC "-//OASIS//DTD DocBook V3.1//EN" [
<!entity version "7.1"> <!entity version "7.1">
<!entity majorversion "7.1"> <!entity majorversion "7.1">
@ -112,82 +112,19 @@ $Header: /cvsroot/pgsql/doc/src/sgml/postgres.sgml,v 1.39 2000/07/21 00:44:13 pe
]> ]>
<!-- entity manpages SYSTEM "man/manpages.sgml" subdoc --> <!-- entity manpages SYSTEM "man/manpages.sgml" subdoc -->
<book id="postgres"> <set id="postgres">
<title>PostgreSQL Documentation</title>
<!-- Title information --> <book id="user">
<title>PostgreSQL</title>
<bookinfo>
<releaseinfo>Covering v7.0 for general release</releaseinfo>
<bookbiblio>
<authorgroup>
<corpauthor>The PostgreSQL Development Team</corpauthor>
</authorgroup>
<!-- editor in authorgroup is not supported
<AuthorGroup>
-->
<editor>
<firstname>Thomas</firstname>
<surname>Lockhart</surname>
<affiliation>
<orgname>Caltech/JPL</orgname>
</affiliation>
</editor>
<!--
</AuthorGroup>
-->
<!--
<AuthorInitials>TGL</AuthorInitials>
-->
<date>(last updated 2000-05-01)</date>
</bookbiblio>
<legalnotice>
<para>
<productname>PostgreSQL</productname> is Copyright &copy; 1996-2000
by PostgreSQL Inc.
</para>
</legalnotice>
</bookinfo>
<!--
<TOC> </TOC>
<LOT> </LOT>
-->
<!--
<Dedication>
<Para>
Your name here...
</Para>
</Dedication>
-->
<preface id="preface">
<title>Summary</title>
<para>
<productname>Postgres</productname>,
developed originally in the UC Berkeley Computer Science Department,
pioneered many of the object-relational concepts
now becoming available in some commercial databases.
It provides SQL92/SQL3 language support,
transaction integrity, and type extensibility.
<productname>PostgreSQL</productname> is an
open-source descendant of this original Berkeley code.
</para>
</preface>
<part id="part-user">
<title>User's Guide</title> <title>User's Guide</title>
<partintro>
<para> <bookinfo>
Information for users. <abstract>
</para> <para>
</partintro> Information for Users
</para>
</abstract>
</bookinfo>
&intro; &intro;
&syntax; &syntax;
@ -208,15 +145,25 @@ Your name here...
&plan; &plan;
&populate; &populate;
&commands; &commands;
</part>
<part id="part-admin"> &datetime;
<!--
&contacts;
-->
&biblio;
</book>
<book id="admin">
<title>Administrator's Guide</title> <title>Administrator's Guide</title>
<partintro>
<para> <bookinfo>
Installation and maintenance information. <abstract>
</para> <para>
</partintro> Information for Administrators
</para>
</abstract>
</bookinfo>
<!-- <!--
Disable these extra intro chapters since some elements (e.g. y2k Disable these extra intro chapters since some elements (e.g. y2k
statement) are included in the first intro.sgml and cause errors if statement) are included in the first intro.sgml and cause errors if
@ -233,15 +180,19 @@ Your name here...
&recovery; &recovery;
&regress; &regress;
&release; &release;
</part> </book>
<part id="part-programmer"> <book id="programmer">
<title>Programmer's Guide</title> <title>Programmer's Guide</title>
<partintro>
<para> <bookinfo>
Information for extending <productname>Postgres</productname>. <abstract>
</para> <para>
</partintro> Information on extending Postgres
</para>
</abstract>
</bookinfo>
<!-- <!--
Disable these extra intro chapters since some elements (e.g. y2k Disable these extra intro chapters since some elements (e.g. y2k
statement) are included in the first intro.sgml and cause errors if statement) are included in the first intro.sgml and cause errors if
@ -262,15 +213,19 @@ Your name here...
&trigger; &trigger;
&spi; &spi;
&xplang; &xplang;
</part> </book>
<part id="part-interfaces"> <book id="interfaces">
<title>Interfaces</title> <title>Interfaces</title>
<partintro>
<para> <bookinfo>
User and programmer interfaces. <abstract>
</para> <para>
</partintro> Information on Postgres language interfaces
</para>
</abstract>
</bookinfo>
&func-ref; &func-ref;
&lobj; &lobj;
&ecpg; &ecpg;
@ -281,16 +236,18 @@ Your name here...
&odbc; &odbc;
&jdbc; &jdbc;
&lisp; &lisp;
</part> </book>
<part id="part-developer"> <book id="developer">
<title>Developer's Guide</title> <title>Developer's Guide</title>
<partintro> <bookinfo>
<para> <abstract>
The Developer's Guide includes discussion of design decisions and <para>
suggestions for future development. Information for Postgres developers
</para> </>
</partintro> </>
</bookinfo>
&sources; &sources;
&arch-dev; &arch-dev;
&geqo; &geqo;
@ -304,38 +261,19 @@ Your name here...
&compiler; &compiler;
&bki; &bki;
&page; &page;
</part> &cvs;
&docguide;
</book>
<part id="part-tutorial"> <book id="tutorial">
<title>Tutorial</title> <title>Tutorial</title>
<partintro>
<para>
Introduction for new users.
</para>
</partintro>
&sql; &sql;
&arch; &arch;
&start; &start;
&query; &query;
&advanced; &advanced;
</part> </book>
<part id="part-appendix">
<title>Appendices</title>
<partintro>
<para>
Additional related information.
</para>
</partintro>
&datetime;
&cvs;
&docguide;
<!--
&contacts;
-->
&biblio;
</part>
<!-- <!--
Omit index until we have some index entries. Omit index until we have some index entries.
@ -344,7 +282,7 @@ Omit index until we have some index entries.
</index> </index>
--> -->
</book> </set>
<!-- Keep this comment at the end of the file <!-- Keep this comment at the end of the file
Local variables: Local variables:

View File

@ -1,5 +1,5 @@
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/create_function.sgml,v 1.16 2000/08/24 23:36:29 tgl Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/ref/create_function.sgml,v 1.17 2000/08/25 15:17:50 thomas Exp $
Postgres documentation Postgres documentation
--> -->
@ -71,9 +71,9 @@ CREATE FUNCTION <replaceable class="parameter">name</replaceable> ( [ <replaceab
<para> <para>
The return data type. The return data type.
The output type may be specified as a base type, complex type, The output type may be specified as a base type, complex type,
<literal>setof <replaceable class="parameter">type</replaceable></literal>, <option>setof <replaceable class="parameter">type</replaceable></option>,
or <literal>opaque</literal>. or <option>opaque</option>.
The <literal>setof</literal> The <option>setof</option>
modifier indicates that the function will return a set of items, modifier indicates that the function will return a set of items,
rather than a single item. rather than a single item.
</para> </para>
@ -186,28 +186,28 @@ CREATE
<variablelist> <variablelist>
<varlistentry> <varlistentry>
<literal>iscachable</literal> <term>iscachable</term>
<listitem> <listitem>
<para> <para>
<literal>iscachable</literal> indicates that the function always <option>iscachable</option> indicates that the function always
returns the same result when given the same argument values (i.e., returns the same result when given the same argument values (i.e.,
it does not do database lookups or otherwise use information not it does not do database lookups or otherwise use information not
directly present in its parameter list). The optimizer uses directly present in its parameter list). The optimizer uses
<literal>iscachable</literal> to know whether it is safe to <option>iscachable</option> to know whether it is safe to
pre-evaluate a call of the function. pre-evaluate a call of the function.
</para> </para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<literal>isstrict</literal> <term>isstrict</term>
<listitem> <listitem>
<para> <para>
<literal>isstrict</literal> indicates that the function always <option>isstrict</option> indicates that the function always
returns NULL whenever any of its arguments are NULL. If this returns NULL whenever any of its arguments are NULL. If this
attribute is specified, the function is not executed when there attribute is specified, the function is not executed when there
are NULL arguments; instead a NULL result is assumed automatically. are NULL arguments; instead a NULL result is assumed automatically.
When <literal>isstrict</literal> is not specified, the function will When <option>isstrict</option> is not specified, the function will
be called for NULL inputs. It is then the function author's be called for NULL inputs. It is then the function author's
responsibility to check for NULLs if necessary and respond responsibility to check for NULLs if necessary and respond
appropriately. appropriately.

View File

@ -1,5 +1,5 @@
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/ref/insert.sgml,v 1.8 2000/08/23 05:59:11 thomas Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/ref/insert.sgml,v 1.9 2000/08/25 15:17:50 thomas Exp $
Postgres documentation Postgres documentation
--> -->
@ -28,8 +28,6 @@ INSERT INTO <replaceable class="PARAMETER">table</replaceable> [ ( <replaceable
</synopsis> </synopsis>
<refsect2 id="R2-SQL-INSERT-1"> <refsect2 id="R2-SQL-INSERT-1">
<refsect2info>
</refsect2info>
<title> <title>
Inputs Inputs
</title> </title>
@ -89,8 +87,6 @@ INSERT INTO <replaceable class="PARAMETER">table</replaceable> [ ( <replaceable
</refsect2> </refsect2>
<refsect2 id="R2-SQL-INSERT-2"> <refsect2 id="R2-SQL-INSERT-2">
<refsect2info>
</refsect2info>
<title> <title>
Outputs Outputs
</title> </title>
@ -127,8 +123,6 @@ INSERT 0 <replaceable>#</replaceable>
</refsynopsisdiv> </refsynopsisdiv>
<refsect1 id="R1-SQL-INSERT-1"> <refsect1 id="R1-SQL-INSERT-1">
<refsect1info>
</refsect1info>
<title> <title>
Description Description
</title> </title>
@ -225,8 +219,6 @@ INSERT INTO tictactoe (game, board)
</title> </title>
<refsect2 id="R2-SQL-INSERT-4"> <refsect2 id="R2-SQL-INSERT-4">
<refsect2info>
</refsect2info>
<title> <title>
SQL92 SQL92
</title> </title>

View File

@ -1,5 +1,5 @@
<!-- <!--
$Header: /cvsroot/pgsql/doc/src/sgml/xfunc.sgml,v 1.19 2000/08/24 23:36:28 tgl Exp $ $Header: /cvsroot/pgsql/doc/src/sgml/xfunc.sgml,v 1.20 2000/08/25 15:17:37 thomas Exp $
--> -->
<chapter id="xfunc"> <chapter id="xfunc">
@ -87,11 +87,11 @@ $Header: /cvsroot/pgsql/doc/src/sgml/xfunc.sgml,v 1.19 2000/08/24 23:36:28 tgl E
<programlisting> <programlisting>
CREATE FUNCTION tp1 (int4, float8) CREATE FUNCTION tp1 (int4, float8)
RETURNS int4 RETURNS int4
AS ' UPDATE bank AS 'UPDATE bank
SET balance = bank.balance - $2 SET balance = bank.balance - $2
WHERE bank.acctountno = $1; WHERE bank.acctountno = $1;
SELECT 1;' SELECT 1;'
LANGUAGE 'sql'; LANGUAGE 'sql';
</programlisting> </programlisting>
@ -99,7 +99,7 @@ LANGUAGE 'sql';
follows: follows:
<programlisting> <programlisting>
select TP1( 17,100.0); SELECT tp1( 17,100.0);
</programlisting> </programlisting>
</para> </para>
@ -108,10 +108,10 @@ select TP1( 17,100.0);
EMP, and retrieves multiple results: EMP, and retrieves multiple results:
<programlisting> <programlisting>
create function hobbies (EMP) returns setof HOBBIES CREATE FUNCTION hobbies (EMP) RETURNS SET OF hobbies
as 'select HOBBIES.* from HOBBIES AS 'SELECT hobbies.* FROM hobbies
where $1.name = HOBBIES.person' WHERE $1.name = hobbies.person'
language 'sql'; LANGUAGE 'sql';
</programlisting> </programlisting>
</para> </para>
</sect2> </sect2>
@ -125,17 +125,17 @@ create function hobbies (EMP) returns setof HOBBIES
<programlisting> <programlisting>
CREATE FUNCTION one() CREATE FUNCTION one()
RETURNS int4 RETURNS int4
AS 'SELECT 1 as RESULT;' AS 'SELECT 1 as RESULT;'
LANGUAGE 'sql'; LANGUAGE 'sql';
SELECT one() AS answer; SELECT one() AS answer;
+-------+ +-------+
|answer | |answer |
+-------+ +-------+
|1 | |1 |
+-------+ +-------+
</programlisting> </programlisting>
</para> </para>
<para> <para>
@ -152,17 +152,17 @@ SELECT one() AS answer;
<programlisting> <programlisting>
CREATE FUNCTION add_em(int4, int4) CREATE FUNCTION add_em(int4, int4)
RETURNS int4 RETURNS int4
AS 'SELECT $1 + $2;' AS 'SELECT $1 + $2;'
LANGUAGE 'sql'; LANGUAGE 'sql';
SELECT add_em(1, 2) AS answer; SELECT add_em(1, 2) AS answer;
+-------+ +-------+
|answer | |answer |
+-------+ +-------+
|3 | |3 |
+-------+ +-------+
</programlisting> </programlisting>
</para> </para>
</sect2> </sect2>
@ -180,20 +180,20 @@ SELECT add_em(1, 2) AS answer;
<programlisting> <programlisting>
CREATE FUNCTION double_salary(EMP) CREATE FUNCTION double_salary(EMP)
RETURNS int4 RETURNS int4
AS 'SELECT $1.salary * 2 AS salary;' AS 'SELECT $1.salary * 2 AS salary;'
LANGUAGE 'sql'; LANGUAGE 'sql';
SELECT name, double_salary(EMP) AS dream SELECT name, double_salary(EMP) AS dream
FROM EMP FROM EMP
WHERE EMP.cubicle ~= '(2,1)'::point; WHERE EMP.cubicle ~= '(2,1)'::point;
+-----+-------+
|name | dream | +-----+-------+
+-----+-------+ |name | dream |
|Sam | 2400 | +-----+-------+
+-----+-------+ |Sam | 2400 |
+-----+-------+
</programlisting> </programlisting>
</para> </para>
<para> <para>
@ -213,11 +213,11 @@ SELECT name(EMP) AS youngster
FROM EMP FROM EMP
WHERE age(EMP) &lt; 30; WHERE age(EMP) &lt; 30;
+----------+ +----------+
|youngster | |youngster |
+----------+ +----------+
|Sam | |Sam |
+----------+ +----------+
</programlisting> </programlisting>
</para> </para>
<para> <para>
@ -230,12 +230,12 @@ SELECT name(EMP) AS youngster
<programlisting> <programlisting>
CREATE FUNCTION new_emp() CREATE FUNCTION new_emp()
RETURNS EMP RETURNS EMP
AS ' SELECT \'None\'::text AS name, AS 'SELECT \'None\'::text AS name,
1000 AS salary, 1000 AS salary,
25 AS age, 25 AS age,
\'(2,2)\'::point AS cubicle' \'(2,2)\'::point AS cubicle'
LANGUAGE 'sql'; LANGUAGE 'sql';
</programlisting> </programlisting>
</para> </para>
<para> <para>
@ -274,11 +274,11 @@ ERROR: function declared to return emp returns varchar instead of text at colum
<programlisting> <programlisting>
SELECT name(new_emp()) AS nobody; SELECT name(new_emp()) AS nobody;
+-------+ +-------+
|nobody | |nobody |
+-------+ +-------+
|None | |None |
+-------+ +-------+
</programlisting> </programlisting>
</para> </para>
</listitem> </listitem>
@ -310,19 +310,19 @@ NOTICE:parser: syntax error at or near "."
<programlisting> <programlisting>
CREATE FUNCTION clean_EMP () CREATE FUNCTION clean_EMP ()
RETURNS int4 RETURNS int4
AS ' DELETE FROM EMP AS 'DELETE FROM EMP
WHERE EMP.salary &lt;= 0; WHERE EMP.salary &lt;= 0;
SELECT 1 AS ignore_this;' SELECT 1 AS ignore_this;'
LANGUAGE 'sql'; LANGUAGE 'sql';
SELECT clean_EMP(); SELECT clean_EMP();
+--+ +--+
|x | |x |
+--+ +--+
|1 | |1 |
+--+ +--+
</programlisting> </programlisting>
</para> </para>
</sect2> </sect2>