Re: What is the maximum length of an IN(a,b,c....d) list in PostgreSQL - Mailing list pgsql-general

From Michael Fuhr
Subject Re: What is the maximum length of an IN(a,b,c....d) list in PostgreSQL
Date
Msg-id 20060120022453.GA30715@winnie.fuhr.org
Whole thread Raw
In response to What is the maximum length of an IN(a,b,c....d) list in PostgreSQL  (frank church <pgsql@adontendev.net>)
List pgsql-general
On Fri, Jan 20, 2006 at 01:49:03AM +0000, frank church wrote:
> What is the maximum length of an IN(a,b,c....d) list in PostgreSQL?
>
> I am using 7.4.

In 7.4 and earlier it depends on the max_expr_depth setting.

http://www.postgresql.org/docs/7.4/static/runtime-config.html#RUNTIME-CONFIG-CLIENT-OTHER

test=> SHOW max_expr_depth;
 max_expr_depth
----------------
 10000
(1 row)

test=> SELECT 1 FROM pg_class WHERE oid IN (1,2,3,4,5,6,7,8,9,10);
 ?column?
----------
(0 rows)

test=> SET max_expr_depth TO 10;
SET
test=> SELECT 1 FROM pg_class WHERE oid IN (1,2,3,4,5,6,7,8,9,10);
ERROR:  expression too complex
DETAIL:  Nesting depth exceeds maximum expression depth 10.
HINT:  Increase the configuration parameter "max_expr_depth".

In 8.0 and later max_expr_depth is gone and the limit depends on
max_stack_depth.

http://www.postgresql.org/docs/8.0/static/runtime-config.html#RUNTIME-CONFIG-RESOURCE

--
Michael Fuhr

pgsql-general by date:

Previous
From: Rodrigo Gonzalez
Date:
Subject: Re: Upgrade Problem: 7.4.3 -> 8.1.2
Next
From: Michael Fuhr
Date:
Subject: Re: selecting array slice problem