Re: Explain analyze gives bogus varno for dblink views

From: Kris Jurka <books(at)ejurka(dot)com>
To: Kris Jurka <jurka(at)ejurka(dot)com>
Cc: <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Explain analyze gives bogus varno for dblink views
Date: 2002-12-05 10:45:47
Message-ID: Pine.LNX.4.33.0212050544560.10610-100000@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs


This behavior is present in 7.3 as well.

On Thu, 5 Dec 2002, Kris Jurka wrote:

> Using the old < 7.3 version of dblink on 7.4devel gives a
> "get_names_for_var: bogus varno 5" error.
>
> Install the deprecated version of dblink by following the directions in
> the dblink.sql file to comment / uncomment various parts of the script.
>
> DROP TABLE t1;
> CREATE TABLE t1 (a int);
>
> DROP TABLE t2;
> CREATE TABLE t2 (a int, b int);
>
> INSERT INTO t1 (a) VALUES (1);
>
> INSERT INTO t2 (a,b) VALUES (1,1);
> INSERT INTO t2 (a,b) VALUES (1,2);
>
> DROP VIEW v1;
> CREATE VIEW v1 AS
> SELECT dblink_tok(t1.dblink_p,0) as a
> FROM (SELECT dblink('hostaddr=127.0.0.1 port=5740 dbname=dblink
> user=jurka password=','SELECT a FROM t1') as dblink_p) AS t1;
>
> DROP VIEW v2;
> CREATE VIEW v2 AS
> SELECT dblink_tok(t2.dblink_p,0) as a,dblink_tok(t2.dblink_p,1) as b
> FROM (SELECT dblink('hostaddr=127.0.0.1 port=5740 dbname=dblink
> user=jurka password=','SELECT a,b FROM t2') as dblink_p) AS t2;
>
> SELECT * FROM t1,t2 WHERE t1.a=t2.a AND t1.a=1;
>
> EXPLAIN ANALYZE
> SELECT * FROM v1,v2 WHERE v1.a=v2.a AND v1.a=1;
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo(at)postgresql(dot)org
>

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Robert Osowiecki 2002-12-05 13:28:10 Cannot create view with subquery and join clause
Previous Message Kris Jurka 2002-12-05 10:28:37 Explain analyze gives bogus varno for dblink views