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>
@ -157,7 +157,7 @@ END;
<varlistentry>
<term>
<replaceable>name</replaceable> [ CONSTANT ]
<replaceable>type</replaceable>> [ NOT NULL ] [ DEFAULT | :=
<replaceable>type</replaceable> [ NOT NULL ] [ DEFAULT | :=
<replaceable>value</replaceable> ];
</term>
<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>
@ -280,7 +280,7 @@ CREATE FUNCTION trigfunc_modcount() RETURNS OPAQUE AS '
return [array get NEW]
' 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
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
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.
</para>
</listitem>
@ -407,7 +407,7 @@ spi_exec -array C "SELECT * FROM pg_class" {
</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>
<para>
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 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 -->
<book id="postgres">
<set id="postgres">
<title>PostgreSQL Documentation</title>
<!-- Title information -->
<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">
<book id="user">
<title>User's Guide</title>
<partintro>
<para>
Information for users.
</para>
</partintro>
<bookinfo>
<abstract>
<para>
Information for Users
</para>
</abstract>
</bookinfo>
&intro;
&syntax;
@ -208,15 +145,25 @@ Your name here...
&plan;
&populate;
&commands;
</part>
<part id="part-admin">
&datetime;
<!--
&contacts;
-->
&biblio;
</book>
<book id="admin">
<title>Administrator's Guide</title>
<partintro>
<para>
Installation and maintenance information.
</para>
</partintro>
<bookinfo>
<abstract>
<para>
Information for Administrators
</para>
</abstract>
</bookinfo>
<!--
Disable these extra intro chapters since some elements (e.g. y2k
statement) are included in the first intro.sgml and cause errors if
@ -233,15 +180,19 @@ Your name here...
&recovery;
&regress;
&release;
</part>
</book>
<part id="part-programmer">
<book id="programmer">
<title>Programmer's Guide</title>
<partintro>
<para>
Information for extending <productname>Postgres</productname>.
</para>
</partintro>
<bookinfo>
<abstract>
<para>
Information on extending Postgres
</para>
</abstract>
</bookinfo>
<!--
Disable these extra intro chapters since some elements (e.g. y2k
statement) are included in the first intro.sgml and cause errors if
@ -262,15 +213,19 @@ Your name here...
&trigger;
&spi;
&xplang;
</part>
</book>
<part id="part-interfaces">
<book id="interfaces">
<title>Interfaces</title>
<partintro>
<para>
User and programmer interfaces.
</para>
</partintro>
<bookinfo>
<abstract>
<para>
Information on Postgres language interfaces
</para>
</abstract>
</bookinfo>
&func-ref;
&lobj;
&ecpg;
@ -281,16 +236,18 @@ Your name here...
&odbc;
&jdbc;
&lisp;
</part>
</book>
<part id="part-developer">
<book id="developer">
<title>Developer's Guide</title>
<partintro>
<para>
The Developer's Guide includes discussion of design decisions and
suggestions for future development.
</para>
</partintro>
<bookinfo>
<abstract>
<para>
Information for Postgres developers
</>
</>
</bookinfo>
&sources;
&arch-dev;
&geqo;
@ -304,38 +261,19 @@ Your name here...
&compiler;
&bki;
&page;
</part>
&cvs;
&docguide;
</book>
<part id="part-tutorial">
<book id="tutorial">
<title>Tutorial</title>
<partintro>
<para>
Introduction for new users.
</para>
</partintro>
&sql;
&arch;
&start;
&query;
&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.
@ -344,7 +282,7 @@ Omit index until we have some index entries.
</index>
-->
</book>
</set>
<!-- Keep this comment at the end of the file
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
-->
@ -71,9 +71,9 @@ CREATE FUNCTION <replaceable class="parameter">name</replaceable> ( [ <replaceab
<para>
The return data type.
The output type may be specified as a base type, complex type,
<literal>setof <replaceable class="parameter">type</replaceable></literal>,
or <literal>opaque</literal>.
The <literal>setof</literal>
<option>setof <replaceable class="parameter">type</replaceable></option>,
or <option>opaque</option>.
The <option>setof</option>
modifier indicates that the function will return a set of items,
rather than a single item.
</para>
@ -186,28 +186,28 @@ CREATE
<variablelist>
<varlistentry>
<literal>iscachable</literal>
<term>iscachable</term>
<listitem>
<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.,
it does not do database lookups or otherwise use information not
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.
</para>
</listitem>
</varlistentry>
<varlistentry>
<literal>isstrict</literal>
<term>isstrict</term>
<listitem>
<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
attribute is specified, the function is not executed when there
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
responsibility to check for NULLs if necessary and respond
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
-->
@ -28,8 +28,6 @@ INSERT INTO <replaceable class="PARAMETER">table</replaceable> [ ( <replaceable
</synopsis>
<refsect2 id="R2-SQL-INSERT-1">
<refsect2info>
</refsect2info>
<title>
Inputs
</title>
@ -89,8 +87,6 @@ INSERT INTO <replaceable class="PARAMETER">table</replaceable> [ ( <replaceable
</refsect2>
<refsect2 id="R2-SQL-INSERT-2">
<refsect2info>
</refsect2info>
<title>
Outputs
</title>
@ -127,8 +123,6 @@ INSERT 0 <replaceable>#</replaceable>
</refsynopsisdiv>
<refsect1 id="R1-SQL-INSERT-1">
<refsect1info>
</refsect1info>
<title>
Description
</title>
@ -225,8 +219,6 @@ INSERT INTO tictactoe (game, board)
</title>
<refsect2 id="R2-SQL-INSERT-4">
<refsect2info>
</refsect2info>
<title>
SQL92
</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">
@ -87,11 +87,11 @@ $Header: /cvsroot/pgsql/doc/src/sgml/xfunc.sgml,v 1.19 2000/08/24 23:36:28 tgl E
<programlisting>
CREATE FUNCTION tp1 (int4, float8)
RETURNS int4
AS ' UPDATE bank
SET balance = bank.balance - $2
WHERE bank.acctountno = $1;
SELECT 1;'
RETURNS int4
AS 'UPDATE bank
SET balance = bank.balance - $2
WHERE bank.acctountno = $1;
SELECT 1;'
LANGUAGE 'sql';
</programlisting>
@ -99,7 +99,7 @@ LANGUAGE 'sql';
follows:
<programlisting>
select TP1( 17,100.0);
SELECT tp1( 17,100.0);
</programlisting>
</para>
@ -108,10 +108,10 @@ select TP1( 17,100.0);
EMP, and retrieves multiple results:
<programlisting>
create function hobbies (EMP) returns setof HOBBIES
as 'select HOBBIES.* from HOBBIES
where $1.name = HOBBIES.person'
language 'sql';
CREATE FUNCTION hobbies (EMP) RETURNS SET OF hobbies
AS 'SELECT hobbies.* FROM hobbies
WHERE $1.name = hobbies.person'
LANGUAGE 'sql';
</programlisting>
</para>
</sect2>
@ -125,17 +125,17 @@ create function hobbies (EMP) returns setof HOBBIES
<programlisting>
CREATE FUNCTION one()
RETURNS int4
AS 'SELECT 1 as RESULT;'
LANGUAGE 'sql';
RETURNS int4
AS 'SELECT 1 as RESULT;'
LANGUAGE 'sql';
SELECT one() AS answer;
+-------+
|answer |
+-------+
|1 |
+-------+
+-------+
|answer |
+-------+
|1 |
+-------+
</programlisting>
</para>
<para>
@ -152,17 +152,17 @@ SELECT one() AS answer;
<programlisting>
CREATE FUNCTION add_em(int4, int4)
RETURNS int4
AS 'SELECT $1 + $2;'
LANGUAGE 'sql';
RETURNS int4
AS 'SELECT $1 + $2;'
LANGUAGE 'sql';
SELECT add_em(1, 2) AS answer;
+-------+
|answer |
+-------+
|3 |
+-------+
+-------+
|answer |
+-------+
|3 |
+-------+
</programlisting>
</para>
</sect2>
@ -180,20 +180,20 @@ SELECT add_em(1, 2) AS answer;
<programlisting>
CREATE FUNCTION double_salary(EMP)
RETURNS int4
AS 'SELECT $1.salary * 2 AS salary;'
LANGUAGE 'sql';
RETURNS int4
AS 'SELECT $1.salary * 2 AS salary;'
LANGUAGE 'sql';
SELECT name, double_salary(EMP) AS dream
FROM EMP
WHERE EMP.cubicle ~= '(2,1)'::point;
FROM EMP
WHERE EMP.cubicle ~= '(2,1)'::point;
+-----+-------+
|name | dream |
+-----+-------+
|Sam | 2400 |
+-----+-------+
+-----+-------+
|name | dream |
+-----+-------+
|Sam | 2400 |
+-----+-------+
</programlisting>
</para>
<para>
@ -213,11 +213,11 @@ SELECT name(EMP) AS youngster
FROM EMP
WHERE age(EMP) &lt; 30;
+----------+
|youngster |
+----------+
|Sam |
+----------+
+----------+
|youngster |
+----------+
|Sam |
+----------+
</programlisting>
</para>
<para>
@ -230,12 +230,12 @@ SELECT name(EMP) AS youngster
<programlisting>
CREATE FUNCTION new_emp()
RETURNS EMP
AS ' SELECT \'None\'::text AS name,
1000 AS salary,
25 AS age,
\'(2,2)\'::point AS cubicle'
LANGUAGE 'sql';
RETURNS EMP
AS 'SELECT \'None\'::text AS name,
1000 AS salary,
25 AS age,
\'(2,2)\'::point AS cubicle'
LANGUAGE 'sql';
</programlisting>
</para>
<para>
@ -274,11 +274,11 @@ ERROR: function declared to return emp returns varchar instead of text at colum
<programlisting>
SELECT name(new_emp()) AS nobody;
+-------+
|nobody |
+-------+
|None |
+-------+
+-------+
|nobody |
+-------+
|None |
+-------+
</programlisting>
</para>
</listitem>
@ -310,19 +310,19 @@ NOTICE:parser: syntax error at or near "."
<programlisting>
CREATE FUNCTION clean_EMP ()
RETURNS int4
AS ' DELETE FROM EMP
WHERE EMP.salary &lt;= 0;
SELECT 1 AS ignore_this;'
LANGUAGE 'sql';
RETURNS int4
AS 'DELETE FROM EMP
WHERE EMP.salary &lt;= 0;
SELECT 1 AS ignore_this;'
LANGUAGE 'sql';
SELECT clean_EMP();
+--+
|x |
+--+
|1 |
+--+
+--+
|x |
+--+
|1 |
+--+
</programlisting>
</para>
</sect2>