Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-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

pgsql-hackers by date

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

pgsql-general by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group