pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedMax input parameter for a function
3+ messages / 3 participants
[nested] [flat]
* Max input parameter for a function
@ 2003-10-20 06:28 Kumar <sgnerd@yahoo.com.sg>
2003-10-20 12:29 ` Re: Max input parameter for a function Christopher Browne <cbbrowne@acm.org>
0 siblings, 1 reply; 3+ messages in thread
From: Kumar @ 2003-10-20 06:28 UTC (permalink / raw)
To: pgsql-sql
Dear friends,
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.
I am using Postgres 7.3.4 on RH Linux 7.2.
Note: I can't use 2 functions , one to insert 32 rows into the table first and the update the remaining columns with other function. Because there are only 27 columns that are not null.
Please shed some light.
Regards
Kumar
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Max input parameter for a function
2003-10-20 06:28 Max input parameter for a function Kumar <sgnerd@yahoo.com.sg>
@ 2003-10-20 12:29 ` Christopher Browne <cbbrowne@acm.org>
0 siblings, 0 replies; 3+ messages in thread
From: Christopher Browne @ 2003-10-20 12:29 UTC (permalink / raw)
To: pgsql-sql
After a long battle with technology,sgnerd@yahoo.com.sg ("Kumar"), an earthling, wrote:
> 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.
>
> I am using Postgres 7.3.4 on RH Linux 7.2.
>
> Note: I can't use 2 functions , one to insert 32 rows into the table
> first and the update the remaining columns with other
> function. Because there are only 27 columns that are not null.
The default compiled in is to limit the number of parameters to 32.
You can recompile it and modify the number of input parameters.
Somehow, the notion of a table with 55 columns strikes me as a
situation where normalization is likely to be BADLY needed...
--
output = reverse("gro.gultn" "@" "enworbbc")
http://www.ntlug.org/~cbbrowne/linux.html
Rules of the Evil Overlord #156. "If I have the hero and his party
trapped, I will not wait until my Superweapon charges to finish them
off if more conventional means are available."
<http://www.eviloverlord.com/;
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Fw: Max input parameter for a function
@ 2003-10-21 16:33 Josh Berkus <josh@agliodbs.com>
0 siblings, 0 replies; 3+ messages in thread
From: Josh Berkus @ 2003-10-21 16:33 UTC (permalink / raw)
To: Kumar <sgnerd@yahoo.com.sg>; +Cc: pgsql-sql
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
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2003-10-21 16:33 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2003-10-20 06:28 Max input parameter for a function Kumar <sgnerd@yahoo.com.sg>
2003-10-20 12:29 ` Christopher Browne <cbbrowne@acm.org>
2003-10-21 16:33 Re: Fw: Max input parameter for a function Josh Berkus <josh@agliodbs.com>
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