Re: lots of values for IN() clause

From: Shelby Cain <alyandon(at)yahoo(dot)com>
To: Markus Schiltknecht <markus(at)bluegap(dot)ch>, pgsql general <pgsql-general(at)postgresql(dot)org>
Subject: Re: lots of values for IN() clause
Date: 2006-11-02 15:48:58
Message-ID: 20061102154858.36052.qmail@web55412.mail.re4.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I don't get a segfault on 8.0.8 under linux or 8.1.4 under win32. The backend (correctly I assume) issues a hint to increase max_stack_depth in both cases.

$ psql -h localhost -p 5432 -d test -U readwrite < script.sql

Password:

CREATE TABLE

ERROR: stack depth limit exceeded

HINT: Increase the configuration parameter "max_stack_depth".

DROP TABLE

Regards,

Shelby Cain

----- Original Message ----
From: Markus Schiltknecht <markus(at)bluegap(dot)ch>
To: pgsql general <pgsql-general(at)postgresql(dot)org>
Sent: Thursday, November 2, 2006 9:21:52 AM
Subject: [GENERAL] lots of values for IN() clause

Hi,

One of our PostgreSQL 8.1.5 databases constantly crashed on a certain
query (backend SEGFAULTs). I've figured the crashes were caused by a
very long IN() clause.

You can easily reproduce the crash by feeding the output of the python
script below to your database.

Fortunately, 8.2 (as of 09/19/2006) no longer crashes. Anyway, I think
it would be helpful to have at least a better error message instead of a
SEGFAULT for 8.1. I didn't test earlier versions.

Regards

Markus

python script mentioned:

#!/usr/bin/python

values = 100000

print "CREATE TABLE test (a INT, b INT);"
print "SELECT a, b FROM test WHERE b IN (" + \
",".join([str(x) for x in range(values)]) + \
");"
print "DROP TABLE test;"

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2006-11-02 15:49:12 Re: Weird double single quote issue
Previous Message James Cradock 2006-11-02 15:47:53 Re: PostGIS