Commit 66347691 authored by Neil Conway's avatar Neil Conway

Minor tweaks for PL/PgSQL documentation.

parent 9ea14ef5
<!-- <!--
$PostgreSQL: pgsql/doc/src/sgml/plpgsql.sgml,v 1.76 2005/09/14 21:14:26 neilc Exp $ $PostgreSQL: pgsql/doc/src/sgml/plpgsql.sgml,v 1.77 2005/10/06 20:51:20 neilc Exp $
--> -->
<chapter id="plpgsql"> <chapter id="plpgsql">
...@@ -1593,9 +1593,10 @@ SELECT * FROM some_func(); ...@@ -1593,9 +1593,10 @@ SELECT * FROM some_func();
allow users to define set-returning functions allow users to define set-returning functions
that do not have this limitation. Currently, the point at that do not have this limitation. Currently, the point at
which data begins being written to disk is controlled by the which data begins being written to disk is controlled by the
<varname>work_mem</> configuration variable. Administrators <xref linkend="guc-work-mem" xreflabel="work_mem">
who have sufficient memory to store larger result sets in configuration variable. Administrators who have sufficient
memory should consider increasing this parameter. memory to store larger result sets in memory should consider
increasing this parameter.
</para> </para>
</note> </note>
</sect3> </sect3>
...@@ -2122,14 +2123,13 @@ END; ...@@ -2122,14 +2123,13 @@ END;
</para> </para>
<para> <para>
The <replaceable>condition</replaceable> names can be any of those The <replaceable>condition</replaceable> names can be any of
shown in <xref linkend="errcodes-appendix">. A category name matches those shown in <xref linkend="errcodes-appendix">. A category
any error within its category. name matches any error within its category. The special
The special condition name <literal>OTHERS</> condition name <literal>OTHERS</> matches every error type except
matches every error type except <literal>QUERY_CANCELED</>. <literal>QUERY_CANCELED</>. (It is possible, but often unwise,
(It is possible, but often unwise, to trap to trap <literal>QUERY_CANCELED</> by name.) Condition names are
<literal>QUERY_CANCELED</> by name.) not case-sensitive.
Condition names are not case-sensitive.
</para> </para>
<para> <para>
...@@ -2188,15 +2188,16 @@ END; ...@@ -2188,15 +2188,16 @@ END;
</para> </para>
<example id="plpgsql-upsert-example"> <example id="plpgsql-upsert-example">
<title>Exceptions with UPDATE/INSERT</title> <title>Exceptions with <command>UPDATE</>/<command>INSERT</></title>
<para> <para>
This example uses an <literal>EXCEPTION</> to <command>UPDATE</> or
<command>INSERT</>, as appropriate. This example uses exception handling to perform either
<command>UPDATE</> or <command>INSERT</>, as appropriate.
<programlisting> <programlisting>
CREATE TABLE db (a INT PRIMARY KEY, b TEXT); CREATE TABLE db (a INT PRIMARY KEY, b TEXT);
CREATE FUNCTION merge_db (key INT, data TEXT) RETURNS VOID AS CREATE FUNCTION merge_db(key INT, data TEXT) RETURNS VOID AS
$$ $$
BEGIN BEGIN
LOOP LOOP
...@@ -2216,8 +2217,8 @@ END; ...@@ -2216,8 +2217,8 @@ END;
$$ $$
LANGUAGE plpgsql; LANGUAGE plpgsql;
SELECT merge_db (1, 'david'); SELECT merge_db(1, 'david');
SELECT merge_db (1, 'dennis'); SELECT merge_db(1, 'dennis');
</programlisting> </programlisting>
</para> </para>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment