Re: umlimited arguments on function - Mailing list pgsql-sql

From Robert Treat
Subject Re: umlimited arguments on function
Date
Msg-id 200402152145.15276.xzilla@users.sourceforge.net
Whole thread Raw
In response to umlimited arguments on function  (Christian Hergert <chris@dronestudios.com>)
List pgsql-sql
On Monday 09 February 2004 14:49, Christian Hergert wrote:
> Is it possible to write a function (in sql or plpgsql) that allows for
> an unknown amount of arguments? Something similar to C's printf()
> function.
>

AFAIK no, but I know of two possible work arounds... first is to write 
multiple copies of the function to accept the different number of argument 
combinations you need.  the other thing i've done in the past is to create 
the function as accepting a array as one of its inputs and then handle the 
array structure as needed. (bonus points for doing the second method in 7.3 
where its much more challenging.)  HTH,

Robert Treat
-- 
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Passing composite values to functions
Next
From: "Denis"
Date:
Subject: Re: ORDER BY TIMESTAMP_column ASC, NULL first