Daniel CAUNE <[EMAIL PROTECTED]> writes:
> Is it possible to define a function with some default values?
> CREATE OR REPLACE FUNCTION foo(i IN int, j IN int DEFAULT := 1)

No.  But you can fake many versions of this with a family of functions:

CREATE OR REPLACE FUNCTION foo(i IN int, j IN int) ...

CREATE OR REPLACE FUNCTION foo(i IN int) ... return foo(i, 1) ...

Remember that PG lets you "overload" a function name by using the same
name with different parameter lists.

                        regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match

Reply via email to