If you don't like the use of numbered parameters, you can use PL / PGSQL :
CREATE OR REPLACE FUNCTION spcwriteperson(fname varchar(20)) RETURNS VOID AS $$ BEGIN INSERT INTO person (firstName) VALUES (fname); END $$ LANGUAGE 'plpgsql';
PL / PGSQL will also give you a language similar to SQL Server T-SQL. PL / PGSQL has control structures, variables, and all these fun things. PostgreSQL's SQL implementation is much stricter regarding what functionality is available - it's a great SQL implementation, but it is a query language, not a procedural programming language.
source share