From: Robert Treat <xzilla@users.sourceforge.net>
To: Christian Hergert <chris@dronestudios.com>
To: pgsql-sql@postgresql.org
Subject: Re: umlimited arguments on function
Date: Sun, 15 Feb 2004 21:45:15 -0500
Message-ID: <200402152145.15276.xzilla@users.sourceforge.net> (raw)
In-Reply-To: <1076356148.15912.1.camel@localhost.localdomain>
References: <1076356148.15912.1.camel@localhost.localdomain>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: xzilla@users.sourceforge.net, chris@dronestudios.com
Subject: Re: umlimited arguments on function
In-Reply-To: <200402152145.15276.xzilla@users.sourceforge.net>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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