Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 582D2476340 for ; Wed, 4 Dec 2002 15:11:15 -0500 (EST) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by postgresql.org (Postfix) with ESMTP id D3F5B476B42 for ; Wed, 4 Dec 2002 15:02:51 -0500 (EST) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.6/8.12.6) with ESMTP id gB4K2ipd017790; Wed, 4 Dec 2002 15:02:44 -0500 (EST) To: "Alphasoft" Cc: pgsql-sql@postgresql.org Subject: Re: problem with view in 7.3 In-reply-to: <000a01c29adb$066fc9e0$0a0546c0@alpha.bg> References: <000a01c29adb$066fc9e0$0a0546c0@alpha.bg> Comments: In-reply-to "Alphasoft" message dated "Tue, 03 Dec 2002 16:48:07 +0200" Date: Wed, 04 Dec 2002 15:02:43 -0500 Message-ID: <17789.1039032163@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200212/55 X-Sequence-Number: 10643 "Alphasoft" writes: > In 7.3 when i am trying to recreate the view I received the folowing error : > find_expr_references_walker: bogus varno 8 Found it --- thanks for the test case. The patch is attached, if you want to apply it locally. regards, tom lane *** src/backend/catalog/dependency.c.orig Sat Sep 21 20:37:09 2002 --- src/backend/catalog/dependency.c Wed Dec 4 14:45:58 2002 *************** *** 789,794 **** --- 789,799 ---- else if (rte->rtekind == RTE_JOIN) { /* Scan join output column to add references to join inputs */ + List *save_rtables; + + /* We must make the context appropriate for join's level */ + save_rtables = context->rtables; + context->rtables = rtables; if (var->varattno <= 0 || var->varattno > length(rte->joinaliasvars)) elog(ERROR, "find_expr_references_walker: bogus varattno %d", *************** *** 796,801 **** --- 801,807 ---- find_expr_references_walker((Node *) nth(var->varattno - 1, rte->joinaliasvars), context); + context->rtables = save_rtables; } return false; }