pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedumlimited arguments on function
2+ messages / 2 participants
[nested] [flat]
* umlimited arguments on function
@ 2004-02-09 19:49 Christian Hergert <chris@dronestudios.com>
0 siblings, 1 reply; 2+ messages in thread
From: Christian Hergert @ 2004-02-09 19:49 UTC (permalink / raw)
To: pgsql-sql
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.
~ chris
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: umlimited arguments on function
@ 2004-02-16 02:45 Robert Treat <xzilla@users.sourceforge.net>
parent: Christian Hergert <chris@dronestudios.com>
0 siblings, 0 replies; 2+ messages in thread
From: Robert Treat @ 2004-02-16 02:45 UTC (permalink / raw)
To: Christian Hergert <chris@dronestudios.com>; 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
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2004-02-16 02:45 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-02-09 19:49 umlimited arguments on function Christian Hergert <chris@dronestudios.com>
2004-02-16 02:45 ` Robert Treat <xzilla@users.sourceforge.net>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox