在Stored Proc - PostgreSQL9.5中传递100多个参数

时间:2016-11-02 14:43:15

标签: database postgresql stored-procedures postgresql-9.5

我有一个包含100多个参数的存储过程但由于max_function_args的默认值设置为100,我无法创建此STP。有人可以告诉我如何更改FUNC_MAX_ARGS的值,以便我可以使用超过100个参数创建此STP。

由于

1 个答案:

答案 0 :(得分:1)

错误真的很好,这是错误的做法,但它是pg_config_manual.h中的#define。话虽如此,这听起来像XY problem

   25 /*
   26  * Maximum number of arguments to a function.
   27  *
   28  * The minimum value is 8 (GIN indexes use 8-argument support functions).
   29  * The maximum possible value is around 600 (limited by index tuple size in
   30  * pg_proc's index; BLCKSZ larger than 8K would allow more).  Values larger
   31  * than needed will waste memory and processing time, but do not directly
   32  * cost disk space.
   33  *
   34  * Changing this does not require an initdb, but it does require a full
   35  * backend recompile (including any user-defined C functions).
   36  */
   37 #define FUNC_MAX_ARGS       100