#406 no parameter defaults support

5.0.2
open
Functions (25)
5
2011-02-14
2011-02-14
Yilmaz ULKUSAL
No

You can not define functions with parameter defaults and you can not update a function that has defaults.

ex.
-----
CREATE FUNCTION function_with_default_values(_id1 integer, _id2 integer DEFAULT 1) RETURNS numeric AS
$BODY$
DECLARE
BEGIN
RETURN 1;
END;
$BODY$
LANGUAGE plpgsql VOLATILE;
-----
If you try to edit/update this function you get the following response:

SQL error:
ERROR: cannot remove parameter defaults from existing function
HINT: Use DROP FUNCTION first.

Discussion