Re: Query breaking with unknown expression type (lost s

From: Matthew Gabeler-Lee <mgabelerlee(at)zycos(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Query breaking with unknown expression type (lost s
Date: 2002-12-05 14:50:33
Message-ID: ABABFB80F35AD311848B0090279918EF010B9B68@ZYCOSNT2.hq.zycos.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Sorry 'bout that ...

Here's a test script that is as simple a setup as I've yet found that
reproduces this bug.

create table t1 (k int4, t1c int4);
create table t2 (k int4, t2c int4);
create table t3 (k int4, t3c int4);

insert into t1 values (1, 2);
insert into t2 values (1, 3);
insert into t3 values (1, 4);

-- triggers bug
select * from (select t1.*, (select t2.c from t2 limit 1) as v from t1) t1v
natural left join t3;

-- triggers bug
select * from (select t1.*, (select t2.t2c from t2 limit 1) as v from t1)
t1v
natural inner join t3 where t1v.t1c > 1 and (t3.t3c > 3 or t3.t3c is null);

-- does *not* trigger bug
select * from (select t1.*, (select t2.t2c from t2 limit 1) as v from t1)
t1v
natural right join t3;

-Matt

-----Original Message-----
From: Tom Lane [mailto:tgl(at)sss(dot)pgh(dot)pa(dot)us]
Sent: Wednesday, December 04, 2002 16:37
To: Matthew Gabeler-Lee
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: [GENERAL] Query breaking with unknown expression type (lost
subquery from v iew?)

Matthew Gabeler-Lee <mgabelerlee(at)zycos(dot)com> writes:
> Query, used to work in 7.2.3:
> SELECT * from VResults NATURAL LEFT JOIN qrp_events
> WHERE qrp_score > 45 AND qry_charge < 3 AND vst_valstate IS NULL
> AND (
> (qpe_name = 'autoval.pl' AND qpe_version < 3)
> OR qpe_name IS NULL
> )
> ORDER BY sdt_id ASC, qry_num ASC, qrp_pnum ASC

> If that means subquery, there is a subquery in
> the VResults view, but for some reason that subquery isn't showing up in
the
> explain output!

How do you expect us to debug this when you haven't provided the view
definition?

I'm willing to dig into it if I have a test case to look at, but I don't
have time to try to intuit a test case from an incomplete bug report.
Give me a script to reproduce the failure, please.

regards, tom lane

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Doug McNaught 2002-12-05 14:54:38 Re: Problem compiling 7.3
Previous Message Marc G. Fournier 2002-12-05 14:42:25 Re: [GENERAL] PostgreSQL Global Development Group