Re: subselect bug (was Re: [GENERAL] DBLink: interesting issue)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: subselect bug (was Re: [GENERAL] DBLink: interesting issue)
Дата
Msg-id 2202.1032884231@sss.pgh.pa.us
обсуждение исходный текст
Ответ на subselect bug (was Re: [GENERAL] DBLink: interesting issue)  (Joe Conway <mail@joeconway.com>)
Список pgsql-hackers
Joe Conway <mail@joeconway.com> writes:
> replica=# create table foo(f1 int);
> CREATE TABLE
> replica=# SELECT * FROM foo t WHERE NOT EXISTS (SELECT remoteid FROM (SELECT
> f1 as remoteid FROM foo WHERE f1 = t.f1) AS t1);
> server closed the connection unexpectedly

Ick.

> I'm just starting to dig in to this, but was hoping for any thoughts or
> guidance I can get.

I can look at this, unless you really want to solve it yourself ...

> p.s. Below is a backtrace:

The debug output:

TRAP: FailedAssertion("!(var->varlevelsup > 0 && var->varlevelsup < PlannerQueryLevel)", File: "subselect.c", Line:
81)

suggests that the problem is with variable depth --- I'm guessing that
we're not adjusting varlevelsup correctly at some step of the planning
process.  Offhand I'd expect the innermost "select" to be pulled up into
the parent select (the argument of EXISTS) and probably something is
going wrong with that.
        regards, tom lane


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

Предыдущее
От: "Ross J. Reedstrom"
Дата:
Сообщение: Re: Web site
Следующее
От: Roberto Fichera
Дата:
Сообщение: Re: Problem on PG7.2.2