无命名参数
teledb=# CREATE OR REPLACE PROCEDURE p_unname(text) AS
$$
BEGIN
raise notice '$1=%',$1;
END;
$$
LANGUAGE PLPGSQL;
CREATE PROCEDURE
teledb=# call p_unname('teledb_pg');
NOTICE: $1=teledb_pg
CALL
teledb=#
给标识符指定别名
teledb=# CREATE OR REPLACE PROCEDURE p_specify_name(text) AS
$$
DECLARE
a_xm ALIAS FOR $1; --a_xm是$1的别名
BEGIN
raise notice '$1=%',a_xm;
END;
$$
LANGUAGE PLPGSQL;
CREATE PROCEDURE
teledb=# CALL p_specify_name('teledb_pg');
NOTICE: $1=teledb_pg
CALL
teledb=#
命名参数
teledb=# CREATE OR REPLACE PROCEDURE p_name(a_xm text) AS
$$
BEGIN
raise notice '$1=%',a_xm;
END;
$$
LANGUAGE PLPGSQL;
CREATE PROCEDURE
teledb=# call p_name('teledb_pg');
NOTICE: $1=teledb_pg
CALL
teledb=#