[pgsql-jp: 25172] Re: function の引数の数について

Satoshi Nagayasu snaga @ oak.forus.or.jp
2002年 3月 8日 (金) 22:14:23 JST


永安です。

> 市村と申します。

> 引数を多くすると下のようなエラーが出てしまい、
> 15個までの引数しか受け付けないのですが↓
> 
> psql:sp_chumon1_insert.sql:9: ERROR:  functions cannot have more than 16
> arguments
> psql:sp_chumon1_insert.sql:93: ERROR:  Procedures cannot take more than 16 arguments
> 
> SQLserverのspのように、20個程度の引数でfunctionを実行する方法は
> ないのでしょうか?・・・

ソースを見てみたところ、src/include/pg_config.h の

------------------------------------------------------------------------
/*
 * Maximum number of columns in an index and maximum number of arguments
 * to a function. They must be the same value.
 *
 * The minimum value is 8 (index creation uses 8-argument functions).
 * There is no specific upper limit, although large values will waste
 * system-table space and processing time.
 *
 * CAUTION: changing these requires an initdb.
 *
 * BTW: if you need to call dynamically-loaded old-style C functions that
 * have more than 16 arguments, you will also need to add cases to the
 * switch statement in fmgr_oldstyle() in src/backend/utils/fmgr/fmgr.c.
 * But consider converting such functions to new-style instead...
 */
#define INDEX_MAX_KEYS          16
#define FUNC_MAX_ARGS           INDEX_MAX_KEYS

------------------------------------------------------------------------

あたりが関係ありそうです。

バックエンドの中では FUNC_MAX_ARGS を見ているようです。

上記のコメントを参考に試してみてはいかがでしょうか。

-- 
NAGAYASU Satoshi <snaga @ oak.forus.or.jp>



pgsql-jp メーリングリストの案内