Received: from candle.pha.pa.us (candle.navpoint.com [162.33.245.46]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fAP5TCm64744 for ; Sun, 25 Nov 2001 00:29:13 -0500 (EST) (envelope-from pgman@candle.pha.pa.us) Received: (from pgman@localhost) by candle.pha.pa.us (8.11.6/8.10.1) id fAP5T6G00259; Sun, 25 Nov 2001 00:29:06 -0500 (EST) From: Bruce Momjian Message-Id: <200111250529.fAP5T6G00259@candle.pha.pa.us> Subject: Re: How to create function with unspecified number of input parameters In-Reply-To: <2762.1006663778@sss.pgh.pa.us> "from Tom Lane at Nov 24, 2001 11:49:38 pm" To: Tom Lane Date: Sun, 25 Nov 2001 00:29:05 -0500 (EST) CC: MindTerm , pgsql-sql@postgresql.org X-Mailer: ELM [version 2.4ME+ PL90 (25)] MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII X-Archive-Number: 200111/354 X-Sequence-Number: 5736 > MindTerm writes: > > I am writing to ask how to create function ( CREATE > > FUNCTION ) with unspecified number of input parameters > > CREATE FUNCTION doesn't presently support that. > > If the underlying function is written in C, you can fake it by > issuing multiple CREATE FUNCTION commands with different numbers > of declared parameters, all of which point to the same C function. > Then the C code would have to look at fcinfo->nargs to see how it > had been called. Is this a TODO item? -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026