Thread: Re: Increasing MAX_ARGS

Re: Increasing MAX_ARGS

From
"Josh Berkus"
Date:
Tom,

> src/include.
> 
> If you haven't run configure yet, do that first.

OK.  
1. I modified /src/include/config.h.in
2. I configured postgres.  Config.h correctly shows MAX_ARGS at 32.
3. I built postgres
4. I initdb'd.

As a test, I tried building a function with 20 parameters in Template1.
I got:

"ERROR: Procedures cannot take more than 16 arguments."

What's going on here?  Is there a check for the number of arguments
outside of the compile configuration?

-Josh




______AGLIO DATABASE SOLUTIONS___________________________                                      Josh Berkus Complete
informationtechnology      josh@agliodbs.com  and data management solutions       (415) 565-7293 for law firms, small
businesses       fax 621-2533   and non-profit organizations.      San Francisco
 


Re: Increasing MAX_ARGS

From
Bruce Momjian
Date:
> Tom,
> 
> > src/include.
> > 
> > If you haven't run configure yet, do that first.
> 
> OK.  
> 1. I modified /src/include/config.h.in
> 2. I configured postgres.  Config.h correctly shows MAX_ARGS at 32.
> 3. I built postgres
> 4. I initdb'd.
> 
> As a test, I tried building a function with 20 parameters in Template1.
> I got:
> 
> "ERROR: Procedures cannot take more than 16 arguments."
> 
> What's going on here?  Is there a check for the number of arguments
> outside of the compile configuration?

That should work. The strange part is that I can't find that error
message anywhere in the sources.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


Re: Increasing MAX_ARGS

From
Tom Lane
Date:
"Josh Berkus" <josh@agliodbs.com> writes:
> As a test, I tried building a function with 20 parameters in Template1.
> I got:

> "ERROR: Procedures cannot take more than 16 arguments."

Get out your debugger and find where that's coming from.  We might have
missed someplace that should be using the FUNC_MAX_ARGS symbol instead
of a hardwired constant (though I thought we'd fixed them all the last
time round...)
        regards, tom lane


Re: Increasing MAX_ARGS

From
Tom Lane
Date:
> "Josh Berkus" <josh@agliodbs.com> writes:
>> "ERROR: Procedures cannot take more than 16 arguments."

FWIW, I cannot find any such message string in current sources, nor 7.1,
7.0, or 6.5 sources.  I think this must be coming from some non-Postgres
frontend code.
        regards, tom lane


Re: Increasing MAX_ARGS

From
Bruce Momjian
Date:
> > "Josh Berkus" <josh@agliodbs.com> writes:
> >> "ERROR: Procedures cannot take more than 16 arguments."
> 
> FWIW, I cannot find any such message string in current sources, nor 7.1,
> 7.0, or 6.5 sources.  I think this must be coming from some non-Postgres
> frontend code.

The current message is:
ERROR: function cannot take more than 16 arguments.

--  Bruce Momjian                        |  http://candle.pha.pa.us pgman@candle.pha.pa.us               |  (610)
853-3000+  If your life is a hard drive,     |  830 Blythe Avenue +  Christ can be your backup.        |  Drexel Hill,
Pennsylvania19026
 


Re: Increasing MAX_ARGS

From
Tom Lane
Date:
>> "Josh Berkus" <josh@agliodbs.com> writes:
> "ERROR: Procedures cannot take more than 16 arguments."

> FWIW, I cannot find any such message string in current sources,

Sigh, I was certainly not firing on all cylinders last night.
That *is* the spelling of the message in 7.1 and before --- see
catalog/pg_proc.c.  Are you certain that you recompiled with the new
setting of FUNC_MAX_ARGS?  Unless you did configure --enable-depend,
config.h changes generally require "make clean" before "make all" to
ensure that the changes propagate.
        regards, tom lane


Re: Increasing MAX_ARGS

From
"Josh Berkus"
Date:
Tom,

> Sigh, I was certainly not firing on all cylinders last night.
> That *is* the spelling of the message in 7.1 and before --- see
> catalog/pg_proc.c.  Are you certain that you recompiled with the new
> setting of FUNC_MAX_ARGS?  Unless you did configure --enable-depend,
> config.h changes generally require "make clean" before "make all" to
> ensure that the changes propagate.

Darn.  And I just noticed that 7.2b2 is out.  I guess I'll have to try
the configuration with both versions of Postgrsql.  Any pitfalls in
having 2 versions installed?

-Josh


______AGLIO DATABASE SOLUTIONS___________________________                                      Josh Berkus Complete
informationtechnology      josh@agliodbs.com  and data management solutions       (415) 565-7293 for law firms, small
businesses       fax 621-2533   and non-profit organizations.      San Francisco
 


Re: Increasing MAX_ARGS

From
Tom Lane
Date:
"Josh Berkus" <josh@agliodbs.com> writes:
> Any pitfalls in
> having 2 versions installed?

Give them different install directories, data directories, and port
numbers, and you're good to go --- I run multiple versions routinely.

The --with-pgport and --prefix configure options make it easy to set
up a test version with nonstandard directories and port.
        regards, tom lane


Re: Increasing MAX_ARGS

From
"Josh Berkus"
Date:
Tom, Bruce, Roberto,

Ok, it worked!

I have my first function (a test function, mind you) with 20 parameters.  

To compile and install postgres, I did both ./configure --enable-depend
and make clean.

BTW, pg_dumpall is working beautifully now.  I was able to back up the
server, install the new version, and restore the server ... all in about
15 minutes, from a remote console.  Try to do that with MS SQL Server!

-Josh

P.S. Thank you for your help!

______AGLIO DATABASE SOLUTIONS___________________________                                      Josh Berkus Complete
informationtechnology      josh@agliodbs.com  and data management solutions       (415) 565-7293 for law firms, small
businesses       fax 621-2533   and non-profit organizations.      San Francisco
 


Re: Increasing MAX_ARGS

From
Roberto Mello
Date:
On Thu, Nov 08, 2001 at 09:35:49PM -0800, Josh Berkus wrote:
> Tom, Bruce, Roberto,
> 
> Ok, it worked!
> 
> I have my first function (a test function, mind you) with 20 parameters.  

That's great Josh!
> To compile and install postgres, I did both ./configure --enable-depend
> and make clean.

I think the make clean takes care of enabling dependencies, so the
--enable-depend would be redundant (/me thinks).

I usually rm the config.cache just to be safe.

> BTW, pg_dumpall is working beautifully now.  I was able to back up the
> server, install the new version, and restore the server ... all in about
> 15 minutes, from a remote console.  Try to do that with MS SQL Server!

Heheh. PostgreSQL rocks! :-)

-Roberto

-- 
+----| http://fslc.usu.edu USU Free Software & GNU/Linux Club |------+ Roberto Mello - Computer Science, USU -
http://www.brasileiro.net      http://www.sdl.usu.edu - Space Dynamics Lab, Developer    
 
$$$ not found --  A)bort, R)efinance, D)eclare bankruptcy


Re: Increasing MAX_ARGS

From
Peter Eisentraut
Date:
Roberto Mello writes:

> > To compile and install postgres, I did both ./configure --enable-depend
> > and make clean.
>
> I think the make clean takes care of enabling dependencies, so the
> --enable-depend would be redundant (/me thinks).

No, make clean removes the dependency information.  What --enable-depend
does is to compute the dependencies of *.o files while the file is
compiled the first time.  Then, if you change one of the dependencies and
run make a second time, it will notice the changed dependencies and
recompile.  (Otherwise, nothing might happen or only a subset of the files
will be recompiled, one of which happened to Josh.)  Theoretically, this
should be the default, but it makes the build rather slow and most people
don't need it.

-- 
Peter Eisentraut   peter_e@gmx.net