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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Oleg Lebedev <oleg(dot)lebedev(at)waterford(dot)org>
Subject: Re: subselect bug (was Re: [GENERAL] DBLink: interesting issue)
Date: 2002-09-24 16:17:11
Message-ID: 2202.1032884231@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

Joe Conway <mail(at)joeconway(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Joe Conway 2002-09-24 16:48:02 Re: subselect bug (was Re: [GENERAL] DBLink: interesting
Previous Message Tom Lane 2002-09-24 16:00:13 Re: [GENERAL] CURRENT_TIMESTAMP

Browse pgsql-hackers by date

  From Date Subject
Next Message Roberto Fichera 2002-09-24 16:27:19 Re: Problem on PG7.2.2
Previous Message Tom Lane 2002-09-24 16:00:13 Re: [GENERAL] CURRENT_TIMESTAMP