PL/PgSQL

  • Declarations
CREATE OR REPLACE FUNTION abc(text) returns text as '
DECLARE
id INTEGER := 2;
username text := ''bob'';
result ALIAS FOR $1;
tabrow tab%ROWTYPE
tabcol tab.col%TYPE
rec RECORD;
BEGIN
...
END;' ...
    • %ROWTYPE: empty instance of 'tab'
    • %TYPE: type of a column
    • RECORD: pseudo row, cast at execution time
Prev

Next

Page 32