From 227338b00d498d9e1c5705a1ab118585e5d57c87 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Wed, 10 Mar 2021 11:33:50 -0500 Subject: 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 --- doc/src/sgml/ref/create_function.sgml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'doc/src/sgml/ref/create_function.sgml') 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 USAGE privilege on the argument types and the return type. + + + Refer to for further information on writing + functions. + @@ -578,12 +583,6 @@ CREATE [ OR REPLACE ] FUNCTION - - - Refer to for further information on writing - functions. - - @@ -661,8 +660,7 @@ CREATE FUNCTION foo(int, int default 42) ... Examples - Here are some trivial examples to help you get started. For more - information and examples, see . + Add two integers using a SQL function: CREATE FUNCTION add(integer, integer) RETURNS integer AS 'select $1 + $2;' -- cgit v1.2.3