#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2002
    Location
    philippines
    Posts
    4
    Rep Power
    0

    Smile ERROR: Procedures cannot take more that 16 arguments..


    Hi,
    I'm new to PostGres... When I created a stored function, an insert function which has 31 arguments, I recieve this error. Is this the limitation of PostGres? Or I miss somthing here?
    Please do help me, thanks a lot....
  2. #2
  3. No Profile Picture
    Gödelian monster
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jul 1999
    Location
    Central Florida, USA
    Posts
    2,307
    Rep Power
    61
    Yes, if you look in the Notes section at the bottom of this page, you will see:

    (from pgsql-general) As of PostgreSQL 7.2.x the maximum number of arguments that can be used in a function is 16. You can increase this limit by editing FUNC_MAX_ARGS in src/include/pg_config.h, recompile and re-initdb. Be forwarned there is little data on the performance implications on doing this.
    You can probably best handle this simply by re-thinking your function. For example you might be able to make one argument as an array (http://www.postgresql.org/idocs/index.php?arrays.html), and then extract all your elements inside the function for your insert statement.

    If you are having any more trouble, feel free to post your function code here, and we can suggest alternatives.
    Last edited by rycamor; November 13th, 2002 at 11:48 AM.
    The real n-tier system:

    FreeBSD -> PostgreSQL -> [any_language] -> Apache -> Mozilla/XUL

    Amazon wishlist -- rycamor (at) gmail.com
  4. #3
  5. No Profile Picture
    Gödelian monster
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jul 1999
    Location
    Central Florida, USA
    Posts
    2,307
    Rep Power
    61
    Hey dax,

    If you hadn't noticed, PostgreSQL 7.3 is out. It's a major release. Among many new improvements, functions can now take up to 32 parameters.
    The real n-tier system:

    FreeBSD -> PostgreSQL -> [any_language] -> Apache -> Mozilla/XUL

    Amazon wishlist -- rycamor (at) gmail.com

IMN logo majestic logo threadwatch logo seochat tools logo