Re: lots of values for IN() clause

Поиск
Список
Период
Сортировка
От Shelby Cain
Тема Re: lots of values for IN() clause
Дата
Msg-id 20061102154858.36052.qmail@web55412.mail.re4.yahoo.com
обсуждение исходный текст
Ответ на lots of values for IN() clause  (Markus Schiltknecht <markus@bluegap.ch>)
Ответы Re: lots of values for IN() clause  (Markus Schiltknecht <markus@bluegap.ch>)
Список 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
increasemax_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@bluegap.ch>
To: pgsql general <pgsql-general@postgresql.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






В списке pgsql-general по дате отправления:

Предыдущее
От: James Cradock
Дата:
Сообщение: Re: PostGIS
Следующее
От: "A. Kretschmer"
Дата:
Сообщение: Re: pg_dump question