Doc, more or less: uncomment tutorial example that was fixed long ago.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 13 Jan 2021 20:59:57 +0000 (15:59 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 13 Jan 2021 21:00:03 +0000 (16:00 -0500)
Reverts a portion of commit 344190b7e.  Apparently, back in the
twentieth century we had some issues with multi-statement SQL
functions, but they've worked fine for a long time.

Daniel Westermann

Discussion: https://postgr.es/m/GVAP278MB04242DCBF5E31F528D53FA18D2A90@GVAP278MB0424.CHEP278.PROD.OUTLOOK.COM

src/tutorial/funcs.source

index 7bbda599a6369a6b0d899dd7a8aa98f2847ac399..542b5c81ec95155d37997ff90e957727e1f9b0ae 100644 (file)
@@ -99,24 +99,21 @@ SELECT name(high_pay()) AS overpaid;
 -----------------------------
 -- Creating SQL Functions with multiple SQL statements
 -- you can also create functions that do more than just a SELECT.
---
--- 14MAR99 Clark Evans: Does not quite work, commented out for now.
---
 -----------------------------
 
 -- you may have noticed that Andy has a negative salary. We'll create a
 -- function that removes employees with negative salaries.
---
--- SELECT * FROM EMP;
---
--- CREATE FUNCTION clean_EMP () RETURNS integer
---   AS 'DELETE FROM EMP WHERE EMP.salary <= 0;
---       SELECT 1 AS ignore_this'
---   LANGUAGE SQL;
---
--- SELECT clean_EMP();
---
--- SELECT * FROM EMP;
+
+SELECT * FROM EMP;
+
+CREATE FUNCTION clean_EMP () RETURNS integer
+   AS 'DELETE FROM EMP WHERE EMP.salary <= 0;
+       SELECT 1 AS ignore_this'
+   LANGUAGE SQL;
+
+SELECT clean_EMP();
+
+SELECT * FROM EMP;
 
 
 -----------------------------