> I am running postgres on a Linux system and have been using plpgsql to 
> write functions.  Is there a way to specify default arguments? 

Hello, 

there is no possibility define default arguments. But you can write 
functions with different count of arguments.

CREATE OR REPLACE FUNCTION foo(integer, integer) RETURNS integer AS $$
BEGIN
  RETURN $1 + $2;
END; $$ LANGUAGE plpgsql;

CREATE OR REPLACE FUNCTION foo(integer) RETURNS integer AS $$
BEGIN
  RETURN foo($1,10); -- 10 is "default" value
END; $$ LANGUAGE plpgsql;

Regards
Pavel Stehule


---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Reply via email to