lots of values for IN() clause - Mailing list pgsql-general

From Markus Schiltknecht
Subject lots of values for IN() clause
Date
Msg-id 454A0D10.1050708@bluegap.ch
Whole thread Raw
Responses Re: lots of values for IN() clause
Re: lots of values for IN() clause
List pgsql-general
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;"

pgsql-general by date:

Previous
From: Peter
Date:
Subject: Re: Weird double single quote issue
Next
From: ajay kamath
Date:
Subject: Help Needed in Postgis