doc: Improve types in example
authorPeter Eisentraut <[email protected]>
Fri, 9 Jun 2017 23:49:18 +0000 (19:49 -0400)
committerPeter Eisentraut <[email protected]>
Fri, 9 Jun 2017 23:49:18 +0000 (19:49 -0400)
Reported-by: Nikolaus Thiel <[email protected]>
doc/src/sgml/xfunc.sgml

index 10e3c0cef9fbff1f095d19462ce0d0c7408221c1..05f4312bf3e23f9be4dd3141b81d0859c61726f2 100644 (file)
@@ -302,7 +302,7 @@ SELECT add_em(1, 2) AS answer;
      bank account:
 
 <programlisting>
-CREATE FUNCTION tf1 (accountno integer, debit numeric) RETURNS integer AS $$
+CREATE FUNCTION tf1 (accountno integer, debit numeric) RETURNS numeric AS $$
     UPDATE bank
         SET balance = balance - debit
         WHERE accountno = tf1.accountno;
@@ -333,7 +333,7 @@ SELECT tf1(17, 100.0);
      is:
 
 <programlisting>
-CREATE FUNCTION tf1 (accountno integer, debit numeric) RETURNS integer AS $$
+CREATE FUNCTION tf1 (accountno integer, debit numeric) RETURNS numeric AS $$
     UPDATE bank
         SET balance = balance - debit
         WHERE accountno = tf1.accountno;
@@ -345,7 +345,7 @@ $$ LANGUAGE SQL;
      The same thing could be done in one command using <literal>RETURNING</>:
 
 <programlisting>
-CREATE FUNCTION tf1 (accountno integer, debit numeric) RETURNS integer AS $$
+CREATE FUNCTION tf1 (accountno integer, debit numeric) RETURNS numeric AS $$
     UPDATE bank
         SET balance = balance - debit
         WHERE accountno = tf1.accountno