aboutsummaryrefslogtreecommitdiff
path: root/src/tutorial
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2021-01-13 15:59:57 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2021-01-13 16:00:03 -0500
commitdce62490818170b6479dfe08a28aae4bcdf7cc2d (patch)
tree3bca75eefa25ea8821283086ea1a9253d6d3cf07 /src/tutorial
parent93c39f987e9c019cd28c450ece8a621b2d8ce28a (diff)
downloadpostgresql-dce62490818170b6479dfe08a28aae4bcdf7cc2d.tar.gz
postgresql-dce62490818170b6479dfe08a28aae4bcdf7cc2d.zip
Doc, more or less: uncomment tutorial example that was fixed long ago.
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
Diffstat (limited to 'src/tutorial')
-rw-r--r--src/tutorial/funcs.source25
1 files changed, 11 insertions, 14 deletions
diff --git a/src/tutorial/funcs.source b/src/tutorial/funcs.source
index 7bbda599a63..542b5c81ec9 100644
--- a/src/tutorial/funcs.source
+++ b/src/tutorial/funcs.source
@@ -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;
-----------------------------