plpgsql
authorOleksandr Gavenko <gavenkoa@gmail.com>
Thu, 03 Jan 2019 22:03:33 +0200
changeset 2332 fc34d7c084ba
parent 2331 32dd4ce8e9b2
child 2333 3a371f973644
plpgsql
postgres.rst
--- a/postgres.rst	Thu Jan 03 21:52:00 2019 +0200
+++ b/postgres.rst	Thu Jan 03 22:03:33 2019 +0200
@@ -347,3 +347,23 @@
 https://jdbc.postgresql.org/download.html
   Java/JDBC/Postgres compatibility table.
 
+plpgsql
+=======
+
+Simple function::
+
+  CREATE OR REPLACE FUNCTION incx(x INTEGER)
+  RETURNS INTEGER STABLE AS $$
+    BEGIN
+      RETURN x + 1;
+    END;
+  $$ LANGUAGE plpgsql;
+
+Support for procedures is added only in Postgres v11.
+
+https://www.postgresql.org/docs/current/sql-createfunction.html
+  ``CREATE FUNCTION``.
+https://www.postgresql.org/docs/current/plpgsql-control-structures.html
+  plpgsql control structures.
+https://www.postgresql.org/docs/current/errcodes-appendix.html
+  PostgreSQL Error Codes.
\ No newline at end of file