Re: Fw: Max input parameter for a function - Mailing list pgsql-sql

From Josh Berkus
Subject Re: Fw: Max input parameter for a function
Date
Msg-id 200310210933.44713.josh@agliodbs.com
Whole thread Raw
List 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 postgresql3. Delete the PGDATA directory4. 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
mayimpose a minor performance               penalty on Postgres!5. Re-compile Postgres, starting with "make clean"6.
Runinitdb7. Restore your database cluster from the pg_dumpall file
 

-- 
Josh Berkus
Aglio Database Solutions
San Francisco


pgsql-sql by date:

Previous
From: email lists
Date:
Subject: Re: date_trunc for 5 minutes intervals
Next
From: Peter Eisentraut
Date:
Subject: [postgres] Re: Deutsche PostgreSQL-Mailingliste unter postgresql.org