From: Josh Berkus <josh@agliodbs.com>
To: Kumar <sgnerd@yahoo.com.sg>
Cc: pgsql-sql@postgresql.org
Subject: Re: Fw: Max input parameter for a function
Date: Tue, 21 Oct 2003 09:33:44 -0700
Message-ID: <200310210933.44713.josh@agliodbs.com> (raw)
In-Reply-To: <010301c397b5$be61c8a0$7502a8c0@hdsc.com>
References: <010301c397b5$be61c8a0$7502a8c0@hdsc.com>
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
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: josh@agliodbs.com, sgnerd@yahoo.com.sg
Subject: Re: Fw: Max input parameter for a function
In-Reply-To: <200310210933.44713.josh@agliodbs.com>
* 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