# HG changeset patch # User Oleksandr Gavenko # Date 1546545813 -7200 # Node ID fc34d7c084ba391af2e386288f54f3b7bfdfe717 # Parent 32dd4ce8e9b2f18f11d5a36408f9c8d8a8dbfe10 plpgsql diff -r 32dd4ce8e9b2 -r fc34d7c084ba 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