VIEW definitions broken in 6.5.0

From: "Ross J(dot) Reedstrom" <reedstrm(at)wallace(dot)ece(dot)rice(dot)edu>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: VIEW definitions broken in 6.5.0
Date: 1999-07-19 22:06:34
Message-ID: 19990719170634.A30250@wallace.ece.rice.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hey hackers -
I don't know if this is fixed in 6.5.1 or not, but the definition field
in the pg_views system table is broken in 6.5.0, and this breaks view
editing in pgaccess. The problem is that table qualifications are left
off the fieldnames in both the SELECT clause and the WHERE clause. Minimal
example given below:

test=> create table t1 (textid int4, nextid int4, words text);
CREATE
test=> create table t2 (nextid int4, words text);
CREATE
test=> create view v1 as select t1.textid,t1.words,t2.words as words2
from t1,t2 where t1.nextid=t2.nextid;
CREATE
test=> insert into t1 values (2,1,'some other text');
INSERT 384454 1
test=> insert into t2 values (1,'joint text');
INSERT 384455 1
test=> insert into t1 values (1,1,'some text');
INSERT 384456 1
test=> select * from v1;
textid|words |words2
------+---------------+----------
2|some other text|joint text
1|some text |joint text
(2 rows)

test=> select definition from pg_views where viewname='v1';
definition
-----------------------------------------------------------------------
SELECT "textid", "words", "words" AS "words2" FROM "t1", "t2" WHERE
"nextid" = "nextid"; (1 row)

test=> SELECT "textid", "words", "words" AS "words2" FROM "t1", "t2"
WHERE "nextid" = "nextid";
ERROR: Column 'words' is ambiguous
test=>

--
Ross J. Reedstrom, Ph.D., <reedstrm(at)rice(dot)edu>
NSBRI Research Scientist/Programmer
Computer and Information Technology Institute
Rice University, 6100 S. Main St., Houston, TX 77005

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ross J. Reedstrom 1999-07-19 22:20:15 pg_dump quoting bug
Previous Message Carlos Fonseca 1999-07-19 20:23:22 (Debian Bug#41223) cascaded updates with refint insert bogus data