Hi,

Quote from Section 37.11 of the manual:

# There are no default values for parameters in PostgreSQL.
# You can overload function names in PostgreSQL. This is often used
  to work around the lack of default parameters.

So for your example:

> CREATE FUNCTION test(integer,integer) RETURNS INTEGER AS '
> ...

you should be able to write:

CREATE FUNCTION test(integer) RETURNS INTEGER AS '
BEGIN
  test($1, default_value_for_param2);
END;
' LANGUAGE 'plpgsql';

and also:

CREATE FUNCTION test() RETURNS INTEGER AS '
BEGIN
  test(default_value_for_param1);
END;
' LANGUAGE 'plpgsql';


Hope this is what you were looking for.

--Phil.

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply via email to