doc: Clean up some recently added PL/pgSQL documentation

- Capitalize titles consistently.
- Fix some grammar.
- Group "Obtaining Information About an Error" under "Trapping Errors",
  but make "Obtaining the Call Stack Context Information" its own
  section, since it's not about errors.
This commit is contained in:
Peter Eisentraut 2014-07-29 23:47:16 -04:00
parent 5b7f1f5210
commit 98c5fe5d0d

View File

@ -2641,18 +2641,9 @@ SELECT merge_db(1, 'dennis');
expected. expected.
</para> </para>
</example> </example>
</sect2>
<sect2 id="plpgsql-diagnostics">
<title>Getting Diagnostics Information</title>
<indexterm>
<primary>diagnostics</primary>
<secondary>in PL/pgSQL</secondary>
</indexterm>
<sect3 id="plpgsql-exception-diagnostics"> <sect3 id="plpgsql-exception-diagnostics">
<title>Obtaining information about an error</title> <title>Obtaining Information About an Error</title>
<para> <para>
Exception handlers frequently need to identify the specific error that Exception handlers frequently need to identify the specific error that
@ -2686,7 +2677,7 @@ GET STACKED DIAGNOSTICS <replaceable>variable</replaceable> { = | := } <replacea
</para> </para>
<table id="plpgsql-exception-diagnostics-values"> <table id="plpgsql-exception-diagnostics-values">
<title>Error diagnostics values</title> <title>Error Diagnostics Values</title>
<tgroup cols="3"> <tgroup cols="3">
<thead> <thead>
<row> <row>
@ -2704,17 +2695,17 @@ GET STACKED DIAGNOSTICS <replaceable>variable</replaceable> { = | := } <replacea
<row> <row>
<entry><literal>COLUMN_NAME</literal></entry> <entry><literal>COLUMN_NAME</literal></entry>
<entry>text</entry> <entry>text</entry>
<entry>the name of column related to exception</entry> <entry>the name of the column related to exception</entry>
</row> </row>
<row> <row>
<entry><literal>CONSTRAINT_NAME</literal></entry> <entry><literal>CONSTRAINT_NAME</literal></entry>
<entry>text</entry> <entry>text</entry>
<entry>the name of constraint related to exception</entry> <entry>the name of the constraint related to exception</entry>
</row> </row>
<row> <row>
<entry><literal>PG_DATATYPE_NAME</literal></entry> <entry><literal>PG_DATATYPE_NAME</literal></entry>
<entry>text</entry> <entry>text</entry>
<entry>the name of data type related to exception</entry> <entry>the name of the data type related to exception</entry>
</row> </row>
<row> <row>
<entry><literal>MESSAGE_TEXT</literal></entry> <entry><literal>MESSAGE_TEXT</literal></entry>
@ -2724,12 +2715,12 @@ GET STACKED DIAGNOSTICS <replaceable>variable</replaceable> { = | := } <replacea
<row> <row>
<entry><literal>TABLE_NAME</literal></entry> <entry><literal>TABLE_NAME</literal></entry>
<entry>text</entry> <entry>text</entry>
<entry>the name of table related to exception</entry> <entry>the name of the table related to exception</entry>
</row> </row>
<row> <row>
<entry><literal>SCHEMA_NAME</literal></entry> <entry><literal>SCHEMA_NAME</literal></entry>
<entry>text</entry> <entry>text</entry>
<entry>the name of schema related to exception</entry> <entry>the name of the schema related to exception</entry>
</row> </row>
<row> <row>
<entry><literal>PG_EXCEPTION_DETAIL</literal></entry> <entry><literal>PG_EXCEPTION_DETAIL</literal></entry>
@ -2773,17 +2764,16 @@ END;
</programlisting> </programlisting>
</para> </para>
</sect3> </sect3>
</sect2>
<sect3 id="plpgsql-get-diagnostics-context"> <sect2 id="plpgsql-get-diagnostics-context">
<title>Obtaining the call stack context information</title> <title>Obtaining the Call Stack Context Information</title>
<para>
<synopsis> <synopsis>
GET <optional> CURRENT </optional> DIAGNOSTICS <replaceable>variable</replaceable> { = | := } <replaceable>PG_CONTEXT</replaceable> <optional> , ... </optional>; GET <optional> CURRENT </optional> DIAGNOSTICS <replaceable>variable</replaceable> { = | := } <replaceable>PG_CONTEXT</replaceable> <optional> , ... </optional>;
</synopsis> </synopsis>
<para>
Calling <command>GET DIAGNOSTICS</command> with status Calling <command>GET DIAGNOSTICS</command> with status
item <varname>PG_CONTEXT</> will return a text string with line(s) of item <varname>PG_CONTEXT</> will return a text string with line(s) of
text describing the call stack. The first row refers to the text describing the call stack. The first row refers to the
@ -2820,7 +2810,6 @@ PL/pgSQL function outer_func() line 3 at RETURN
</programlisting> </programlisting>
</para> </para>
</sect3>
</sect2> </sect2>
</sect1> </sect1>
@ -3567,7 +3556,7 @@ RAISE unique_violation USING MESSAGE = 'Duplicate user ID: ' || user_id;
</indexterm> </indexterm>
<sect2 id="plpgsql-dml-trigger"> <sect2 id="plpgsql-dml-trigger">
<title>Triggers on data changes</title> <title>Triggers on Data Changes</title>
<para> <para>
<application>PL/pgSQL</application> can be used to define trigger <application>PL/pgSQL</application> can be used to define trigger
@ -4119,7 +4108,7 @@ SELECT * FROM sales_summary_bytime;
</sect2> </sect2>
<sect2 id="plpgsql-event-trigger"> <sect2 id="plpgsql-event-trigger">
<title>Triggers on events</title> <title>Triggers on Events</title>
<para> <para>
<application>PL/pgSQL</application> can be used to define event <application>PL/pgSQL</application> can be used to define event
@ -4712,7 +4701,7 @@ a_output := a_output || $$ if v_$$ || referrer_keys.kind || $$ like '$$
</sect2> </sect2>
<sect2 id="plpgsql-extra-checks"> <sect2 id="plpgsql-extra-checks">
<title>Additional compile-time checks</title> <title>Additional Compile-time Checks</title>
<para> <para>
To aid the user in finding instances of simple but common problems before To aid the user in finding instances of simple but common problems before