When a function uses the duplicate parameter names, it throws the following error message:
parameter name "<Param_Name>" used more than once
If function definition contains duplicate names, it will throw the following error:
CREATE or replace FUNCTION dup_para(in int, out f1 int, out f1 text) AS $$ SELECT $1, CAST($1 AS text) || ' is text' $$ LANGUAGE SQL; ERROR: parameter name "f1" used more than once
In Greenplum Database (GPDB) 5.x, the use of parameter names is not enforced inside a function. This means the parameter cannot be used inside the function body and you will not see this error.
However, in GPDB 6.x version, we allow a function to refer to the parameter names, which enforces natural uniqueness.
CREATE or replace FUNCTION dup_para(in int, out f1 int, out f2 text) AS $$ SELECT $1, CAST($1 AS text) || ' is text' $$ LANGUAGE SQL; CREATE FUNCTION