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

Cannot create view with subquery and join clause

From: Robert Osowiecki <robson(at)cavern(dot)pl>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Cannot create view with subquery and join clause
Date: 2002-12-05 13:28:10
Message-ID: 3DEF546A.9000009@cavern.pl (view raw or flat)
Thread:
Lists: pgsql-bugs
============================================================================
                         POSTGRESQL BUG REPORT TEMPLATE
============================================================================


Your name		:	Robert Osowiecki
Your email address	:	robson(at)cavern(dot)pl


System Configuration
---------------------
   Architecture: Intel Celeron

   Operating System : Linux version 2.4.16

   PostgreSQL version :   PostgreSQL-7.3

   Compiler used : egcs-2.91.66


Please enter a FULL description of your problem:
------------------------------------------------

I cannot create a view with subquery and join clase.



Please describe a way to repeat the problem.   Please try to provide a
concise reproducible example, if at all possible:
----------------------------------------------------------------------

/** this one works OK */

create view VOrderTest as
select
or_order_nr,

(select sum(sp_qty)
     from TOrdSpecif
     where sp_or_order_nr=or_order_nr)
as or_order_qty
from TOrder;

/** this one fails with
   ERROR:  find_expr_references_walker: bogus varno 3
*//

create view VOrderTest1 as
select
or_order_nr,

(select sum(sp_qty)
     from TOrdSpecif
     where sp_or_order_nr=or_order_nr)
as or_order_qty

from TOrder
join TCategory on (true);


If you know how this problem might be fixed, list the solution below:
---------------------------------------------------------------------

I've looked at find_expr_references_walker source, but it's all voodoo 
to me :-(


Responses

pgsql-bugs by date

Next:From: pgsql-bugsDate: 2002-12-05 15:22:18
Subject: Bug #837: Unable to use LATIN9 (=ISO-8859-15) encoding
Previous:From: Kris JurkaDate: 2002-12-05 10:45:47
Subject: Re: Explain analyze gives bogus varno for dblink views

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