aboutsummaryrefslogtreecommitdiff
path: root/doc/src/sgml/ref/create_function.sgml
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2021-03-10 11:33:50 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2021-03-10 11:33:50 -0500
commit227338b00d498d9e1c5705a1ab118585e5d57c87 (patch)
tree77da0d36d443ed8d5a0e69f988e5ff9fee3f9c22 /doc/src/sgml/ref/create_function.sgml
parent3ebc6d295705fec37dc8f57a4ece54b370f55f72 (diff)
downloadpostgresql-227338b00d498d9e1c5705a1ab118585e5d57c87.tar.gz
postgresql-227338b00d498d9e1c5705a1ab118585e5d57c87.zip
Doc: improve introductory information about procedures.
Clarify the discussion in "User-Defined Procedures", by laying out the key differences between functions and procedures in a bulleted list. Notably, this avoids burying the lede about procedures being able to do transaction control. Make the back-link in the CREATE FUNCTION reference page more prominent, and add one in CREATE PROCEDURE. Per gripe from Guyren Howe. Thanks to David Johnston for discussion. Discussion: https://postgr.es/m/BYAPR03MB4903C53A8BB7EFF5EA289674A6949@BYAPR03MB4903.namprd03.prod.outlook.com
Diffstat (limited to 'doc/src/sgml/ref/create_function.sgml')
-rw-r--r--doc/src/sgml/ref/create_function.sgml14
1 files changed, 6 insertions, 8 deletions
diff --git a/doc/src/sgml/ref/create_function.sgml b/doc/src/sgml/ref/create_function.sgml
index 3c1eaea651c..f1001615f4a 100644
--- a/doc/src/sgml/ref/create_function.sgml
+++ b/doc/src/sgml/ref/create_function.sgml
@@ -100,6 +100,11 @@ CREATE [ OR REPLACE ] FUNCTION
To be able to create a function, you must have <literal>USAGE</literal>
privilege on the argument types and the return type.
</para>
+
+ <para>
+ Refer to <xref linkend="xfunc"/> for further information on writing
+ functions.
+ </para>
</refsect1>
<refsect1>
@@ -578,12 +583,6 @@ CREATE [ OR REPLACE ] FUNCTION
</varlistentry>
</variablelist>
-
- <para>
- Refer to <xref linkend="xfunc"/> for further information on writing
- functions.
- </para>
-
</refsect1>
<refsect1 id="sql-createfunction-overloading">
@@ -661,8 +660,7 @@ CREATE FUNCTION foo(int, int default 42) ...
<title>Examples</title>
<para>
- Here are some trivial examples to help you get started. For more
- information and examples, see <xref linkend="xfunc"/>.
+ Add two integers using a SQL function:
<programlisting>
CREATE FUNCTION add(integer, integer) RETURNS integer
AS 'select $1 + $2;'