.. _Class 54:

==============================
Class 54 Program Limit Exceeded 
==============================



54000
---------

情况名称
^^^^^^^^^^^^^

program_limit_exceeded


中文含义
^^^^^^^^^^^^^

超过数据库对象的限制数


产生原因
^^^^^^^^^^^^^

在使用数据库对象时，超过了数据对象的限制数。如索引，数组等。

示例
^^^^^
 
.. code::

    SELECT cube_subset(cube('(6,7,8),(6,7,8)'), array(SELECT 1 as a FROM generate_series(1,101)));
    ERROR:  array is too long
    DETAIL:  A cube cannot have more than 100 dimensions.

解决方法
^^^^^^^^

使用小限数据库限制数量的对象能力

54001
---------

情况名称
^^^^^^^^^^^^^

statement_too_complex


中文含义
^^^^^^^^^^^^^

语句太复杂


产生原因
^^^^^^^^^^^^^

语句太过复杂，导致系统堆栈深度过大

示例
^^^^^
 
.. code::

	SELECT repeat('[', 10000)::json;
	ERROR:  stack depth limit exceeded
	HINT:  Increase the configuration parameter "max_stack_depth" (currently 100kB), after ensuring the platform's stack depth limit is adequate.

解决方法
^^^^^^^^

改写SQL语句，或者调整系统参数

54011
---------

情况名称
^^^^^^^^^^^^^

too_many_columns


中文含义
^^^^^^^^^^^^^

列太多


产生原因
^^^^^^^^^^^^^

表定义（列数量，外键），或者是分组时使用了超过系统限制数据的列

示例
^^^^^
 
.. code::

	无

解决方法
^^^^^^^^

修改表定义，使其不超过数据库对列数量的限制


54023
---------

情况名称
^^^^^^^^^^^^^

too_many_arguments


中文含义
^^^^^^^^^^^^^

参数太多


产生原因
^^^^^^^^^^^^^

调用函数，存储过程时，使用了超过系统参数个数限制个数的参数。

示例
^^^^^
 
.. code::

	select decode ( 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,
	21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,
	41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,
	61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,
	81,82,83,83,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,
	101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,
	121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,
	141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,
	161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,
	181,182,183,183,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,
	201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,
	221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,
	241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256);
	ERROR:  decode arguments can`t more than 255.
	--here is 441 arguments
	SELECT DECODE(2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1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