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

Explain analyze gives bogus varno for dblink views

From: Kris Jurka <jurka(at)ejurka(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Explain analyze gives bogus varno for dblink views
Date: 2002-12-05 10:28:37
Message-ID: 3DEF2A55.6756C505@ejurka.com (view raw or flat)
Thread:
Lists: pgsql-bugs
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;

Responses

pgsql-bugs by date

Next:From: Kris JurkaDate: 2002-12-05 10:45:47
Subject: Re: Explain analyze gives bogus varno for dblink views
Previous:From: Kris JurkaDate: 2002-12-05 09:49:59
Subject: GEQO Triggers Server Crash

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