PL/PgSQL

  • Block structure
CREATE OR REPLACE FUNCTION test() returns text as '
DECLARE
[variables]
BEGIN
[statements]
END;'
LANGUAGE plpgsql;
    • BEGIN/END not to be confused with transactions (note: no ';' after BEGIN!)
    • Nested sub-blocks
    • Escaping of quotes: "''" for "'"
    Prev

    Next

    Page 31