Re: Function Parameters

From: David Fetter <david(at)fetter(dot)org>
To: Oluwatope Akinniyi <topeakinniyi(at)shepherdhill(dot)biz>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Function Parameters
Date: 2005-01-02 20:56:52
Message-ID: 20050102205652.GD24407@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, Jan 02, 2005 at 01:31:22AM +0000, Oluwatope Akinniyi wrote:
> Hi,
>
> Compliments of the season.
>
> I tried to create a function with about 60 input parameters and got
> an error message that a function cannot take more than 32
> parameters.

Generally, a function with that many input parameters is a sign of a
bad function design, rather than of an unreasonable limit in
PostgreSQL.

> Is there a way around this? Or Am I in error?

Um, how do I put this gently...a function with that many parameters
means it's overwhelmingly likely that you are.

Other people have made suggestions about recompiling PostgreSQL,
hacking the source code, etc., etc. These are things you should only
attempt when you are absolutely certain that there is no other way to
do what you need to do than with a function of 60 parameters.

Here, "absolutely certain" means "having gone over the design of the
entire application, re-doing all of it if needed," because if you go
down the road of having a hand-hacked PostgreSQL, you severely limit
the community's ability to help you when you encounter a problem.

Cheers,
D
--
David Fetter david(at)fetter(dot)org http://fetter.org/
phone: +1 510 893 6100 mobile: +1 415 235 3778

Remember to vote!

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message C. Duncan Hudson 2005-01-02 21:19:26 Re: Shared Sequences?
Previous Message Joost Kraaijeveld 2005-01-02 19:45:46 Re: Select number of children of a parent query