X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 487F2D1B4FD for ; Tue, 21 Oct 2003 16:34:57 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 94667-10 for ; Tue, 21 Oct 2003 13:34:26 -0300 (ADT) Received: from davinci.ethosmedia.com (unknown [209.128.84.228]) by svr1.postgresql.org (Postfix) with ESMTP id 28B69D1B518 for ; Tue, 21 Oct 2003 13:34:25 -0300 (ADT) Received: from [63.195.55.98] (HELO spooky) by davinci.ethosmedia.com (CommuniGate Pro SMTP 4.0.2) with ESMTP id 3801673; Tue, 21 Oct 2003 09:35:04 -0700 Content-Type: text/plain; charset="iso-8859-1" From: Josh Berkus Organization: Aglio Database Solutions To: "Kumar" Subject: Re: Fw: Max input parameter for a function Date: Tue, 21 Oct 2003 09:33:44 -0700 User-Agent: KMail/1.4.3 References: <010301c397b5$be61c8a0$7502a8c0@hdsc.com> In-Reply-To: <010301c397b5$be61c8a0$7502a8c0@hdsc.com> Cc: pgsql-sql@postgresql.org MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-Id: <200310210933.44713.josh@agliodbs.com> X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/266 X-Sequence-Number: 15666 Kumar, > While trying to allocate about 36 input parameters, I got an error saying > that the max input parameter for a function is only 32. > > Is it right? How to overcome this? Because I wanna insert records into a > table of 55 columns with a lot of NULL able columns. First off, if your table has 55 columns and many are nullable, then you have a database design problem ... your database is not normalized. Assuming that you can't fix your database, there's two methods you can take: 1) Rather than pushing in all of the columns as parameters, you can dump the record into a holding table (e.g. mytable_buffer) and then call a procedure to process the data there. 2) You can re-compile PostgreSQL to accept more parameters. This requires: 1. Backup your database cluster using pg_dumpall. (make sure to double-check!) 2. Shut down postgresql 3. Delete the PGDATA directory 4. Go into your postgresql source, and edit the file src/include/pg_config.h , and raise "INDEX_MAX_KEYS" to the desired level, probably 64. Warning: This may impose a minor performance penalty on Postgres! 5. Re-compile Postgres, starting with "make clean" 6. Run initdb 7. Restore your database cluster from the pg_dumpall file -- Josh Berkus Aglio Database Solutions San Francisco