Commit 0923b01e authored by Tom Lane's avatar Tom Lane

Update 9.4 release notes.

Set release date, do a final pass of wordsmithing, improve some other
new-in-9.4 documentation.
parent c50423c0
...@@ -3180,9 +3180,10 @@ SELECT person.name, holidays.num_weeks FROM person, holidays ...@@ -3180,9 +3180,10 @@ SELECT person.name, holidays.num_weeks FROM person, holidays
</indexterm> </indexterm>
<para> <para>
Lines (<type>line</type>) are represented by the linear equation Ax + By Lines are represented by the linear
+ C = 0, where A and B are not both zero. Values of equation <replaceable>A</>x + <replaceable>B</>y + <replaceable>C</> = 0,
type <type>line</type> is input and output in the following form: where <replaceable>A</> and <replaceable>B</> are not both zero. Values
of type <type>line</type> are input and output in the following form:
<synopsis> <synopsis>
{ <replaceable>A</replaceable>, <replaceable>B</replaceable>, <replaceable>C</replaceable> } { <replaceable>A</replaceable>, <replaceable>B</replaceable>, <replaceable>C</replaceable> }
</synopsis> </synopsis>
...@@ -3200,7 +3201,7 @@ SELECT person.name, holidays.num_weeks FROM person, holidays ...@@ -3200,7 +3201,7 @@ SELECT person.name, holidays.num_weeks FROM person, holidays
<literal>(<replaceable>x1</replaceable>,<replaceable>y1</replaceable>)</literal> <literal>(<replaceable>x1</replaceable>,<replaceable>y1</replaceable>)</literal>
and and
<literal>(<replaceable>x2</replaceable>,<replaceable>y2</replaceable>)</literal> <literal>(<replaceable>x2</replaceable>,<replaceable>y2</replaceable>)</literal>
are two (different) points on the line. are two different points on the line.
</para> </para>
</sect2> </sect2>
...@@ -3216,9 +3217,9 @@ SELECT person.name, holidays.num_weeks FROM person, holidays ...@@ -3216,9 +3217,9 @@ SELECT person.name, holidays.num_weeks FROM person, holidays
</indexterm> </indexterm>
<para> <para>
Line segments (<type>lseg</type>) are represented by pairs of points. Line segments are represented by pairs of points that are the endpoints
Values of type <type>lseg</type> are specified using any of the following of the segment. Values of type <type>lseg</type> are specified using any
syntaxes: of the following syntaxes:
<synopsis> <synopsis>
[ ( <replaceable>x1</replaceable> , <replaceable>y1</replaceable> ) , ( <replaceable>x2</replaceable> , <replaceable>y2</replaceable> ) ] [ ( <replaceable>x1</replaceable> , <replaceable>y1</replaceable> ) , ( <replaceable>x2</replaceable> , <replaceable>y2</replaceable> ) ]
......
...@@ -1078,15 +1078,26 @@ END; ...@@ -1078,15 +1078,26 @@ END;
always sets <literal>FOUND</literal> to true. always sets <literal>FOUND</literal> to true.
</para> </para>
<para>
For <command>INSERT</>/<command>UPDATE</>/<command>DELETE</> with
<literal>RETURNING</>, <application>PL/pgSQL</application> reports
an error for more than one returned row, even when
<literal>STRICT</literal> is not specified. This is because there
is no option such as <literal>ORDER BY</> with which to determine
which affected row should be returned.
</para>
<para> <para>
If <literal>print_strict_params</> is enabled for the function, If <literal>print_strict_params</> is enabled for the function,
you will get information about the parameters passed to the then when an error is thrown because the requirements
query in the <literal>DETAIL</> part of the error message produced of <literal>STRICT</> are not met, the <literal>DETAIL</> part of
when the requirements of STRICT are not met. You can change this the error message will include information about the parameters
setting on a system-wide basis by setting passed to the query.
You can change the <literal>print_strict_params</>
setting for all functions by setting
<varname>plpgsql.print_strict_params</>, though only subsequent <varname>plpgsql.print_strict_params</>, though only subsequent
function compilations will be affected. You can also enable it function compilations will be affected. You can also enable it
on a per-function basis by using a compiler option: on a per-function basis by using a compiler option, for example:
<programlisting> <programlisting>
CREATE FUNCTION get_userid(username text) RETURNS int CREATE FUNCTION get_userid(username text) RETURNS int
AS $$ AS $$
...@@ -1100,15 +1111,12 @@ BEGIN ...@@ -1100,15 +1111,12 @@ BEGIN
END END
$$ LANGUAGE plpgsql; $$ LANGUAGE plpgsql;
</programlisting> </programlisting>
</para> On failure, this function might produce an error message such as
<programlisting>
<para> ERROR: query returned no rows
For <command>INSERT</>/<command>UPDATE</>/<command>DELETE</> with DETAIL: parameters: $1 = 'nosuchuser'
<literal>RETURNING</>, <application>PL/pgSQL</application> reports CONTEXT: PL/pgSQL function get_userid(text) line 6 at SQL statement
an error for more than one returned row, even when </programlisting>
<literal>STRICT</literal> is not specified. This is because there
is no option such as <literal>ORDER BY</> with which to determine
which affected row should be returned.
</para> </para>
<note> <note>
...@@ -2767,28 +2775,36 @@ END; ...@@ -2767,28 +2775,36 @@ END;
</sect2> </sect2>
<sect2 id="plpgsql-get-diagnostics-context"> <sect2 id="plpgsql-get-diagnostics-context">
<title>Obtaining the Call Stack Context Information</title> <title>Obtaining Current Execution Information</title>
<para>
The <command>GET <optional> CURRENT </optional> DIAGNOSTICS</command>
command retrieves information about current execution state (whereas
the <command>GET STACKED DIAGNOSTICS</command> command discussed above
reports information about the execution state as of a previous error).
This command has the form:
</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>item</replaceable> <optional> , ... </optional>;
</synopsis> </synopsis>
<para> <para>
Calling <command>GET DIAGNOSTICS</command> with status Currently only one information item is supported. Status
item <varname>PG_CONTEXT</> will return a text string with line(s) of item <literal>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 line refers to the
current function and currently executing <command>GET DIAGNOSTICS</command> current function and currently executing <command>GET DIAGNOSTICS</command>
command. The second and any subsequent rows refer to the calling functions command. The second and any subsequent lines refer to calling functions
up the call stack. further up the call stack. For example:
<programlisting> <programlisting>
CREATE OR REPLACE FUNCTION public.outer_func() RETURNS integer AS $$ CREATE OR REPLACE FUNCTION outer_func() RETURNS integer AS $$
BEGIN BEGIN
RETURN inner_func(); RETURN inner_func();
END; END;
$$ LANGUAGE plpgsql; $$ LANGUAGE plpgsql;
CREATE OR REPLACE FUNCTION public.inner_func() RETURNS integer AS $$ CREATE OR REPLACE FUNCTION inner_func() RETURNS integer AS $$
DECLARE DECLARE
stack text; stack text;
BEGIN BEGIN
...@@ -2801,8 +2817,9 @@ $$ LANGUAGE plpgsql; ...@@ -2801,8 +2817,9 @@ $$ LANGUAGE plpgsql;
SELECT outer_func(); SELECT outer_func();
NOTICE: --- Call Stack --- NOTICE: --- Call Stack ---
PL/pgSQL function inner_func() line 4 at GET DIAGNOSTICS PL/pgSQL function inner_func() line 5 at GET DIAGNOSTICS
PL/pgSQL function outer_func() line 3 at RETURN PL/pgSQL function outer_func() line 3 at RETURN
CONTEXT: PL/pgSQL function outer_func() line 3 at RETURN
outer_func outer_func
------------ ------------
1 1
......
This diff is collapsed.
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