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

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: frank church <pgsql(at)adontendev(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: What is the maximum length of an IN(a, b, c....d) list in PostgreSQL
Date: 2006-01-20 02:24:53
Message-ID: 20060120022453.GA30715@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Fuhr 2006-01-20 02:58:45 Re: selecting array slice problem
Previous Message Rodrigo Gonzalez 2006-01-20 02:12:20 Re: Upgrade Problem: 7.4.3 -> 8.1.2