Thread

  1. Outer joins in views

    PostgreSQL Bugs List <pgsql-bugs@postgresql.org> — 2000-12-04T10:58:26Z

    Grzegorz M. Mucha (mucher@tigana.pl) reports a bug with a severity of 2
    The lower the number the more severe it is.
    
    Short Description
    Outer joins in views
    
    Long Description
    In the 7.1 devel version, the OUTER JOIN statementes are working, but not in VIEWs. I have created the below listed view, and while it allows to be created, any attempt of using it ends with:
    
    ERROR: Internal error: no jointree entry for rel *OLD*
    
    
    Sample Code
    create view ec_recommendations_cats_view as select 
      recs.recommendation_id, 
      COALESCE(cats.category_name,COALESCE(subs.category_name,subsubs.category_name)) AS the_category_name, 
      COALESCE(subs.subcategory_name,subsubs.subcategory_name) AS the_subcategory_name,
      subsubs.subsubcategory_name AS the_subsubcategory_name,
      p.product_name, 
      c.user_class_name
    from ec_products p,
      ec_product_recommendations recs LEFT OUTER JOIN
      ec_categories cats on recs.category_id = cats.category_id
      LEFT OUTER JOIN
      ec_subcategories_augmented subs on recs.subcategory_id = subs.subcategory_id
      LEFT OUTER JOIN
      ec_subsubcategories_augmented subsubs on recs.subsubcategory_id = subsubs.subcategory_id
      left outer join
      ec_user_classes c on recs.user_class_id=c.user_class_id
    where recs.active_p='t'
    and recs.product_id = p.product_id;
    
    No file was uploaded with this report
    
    
    
  2. Re: Outer joins in views

    Tom Lane <tgl@sss.pgh.pa.us> — 2000-12-04T20:10:13Z

    pgsql-bugs@postgresql.org writes:
    > In the 7.1 devel version, the OUTER JOIN statementes are working, but
    > not in VIEWs. I have created the below listed view, and while it
    > allows to be created, any attempt of using it ends with:
    > ERROR: Internal error: no jointree entry for rel *OLD*
    
    Thanks for the report.  However, I can't easily reproduce it with just
    the CREATE VIEW command.  Could I have CREATE TABLE statements for the
    referenced tables, too, please?
    
    			regards, tom lane