pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Chris Ruprecht <chris@ruprecht.org>
Cc: pgsql-sql@postgresql.org
Subject: Re: Variable number or arguments to a function possible?
Date: Fri, 24 Apr 2009 23:09:38 -0400
Message-ID: <25088.1240628978@sss.pgh.pa.us> (raw)
In-Reply-To: <08F9706F-C603-46A2-8D42-5799D700DCE7@ruprecht.org>
References: <08F9706F-C603-46A2-8D42-5799D700DCE7@ruprecht.org>

Chris Ruprecht <chris@ruprecht.org> writes:
> Is it possible to create a function that can take a variable number of  
> arguments?

No, but you can make it take an array and then write something like

	myfunc(array[x, y, ...])

8.4 will have some syntactic sugar that looks like variable numbers of
arguments, but it's reducing to the above underneath.

			regards, tom lane



view thread (3+ messages)

Message-ID: <25088.1240628978@sss.pgh.pa.us>
Permalink:  ../25088.1240628978@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/25088.1240628978@sss.pgh.pa.us

 · 

reply

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: tgl@sss.pgh.pa.us, chris@ruprecht.org
  Subject: Re: Variable number or arguments to a function possible?
  In-Reply-To: <25088.1240628978@sss.pgh.pa.us>

* 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