Re: [HACKERS] VIEW definitions broken in 6.5.0

From: Bruce Momjian <maillist(at)candle(dot)pha(dot)pa(dot)us>
To: "Ross J(dot) Reedstrom" <reedstrm(at)wallace(dot)ece(dot)rice(dot)edu>
Cc: pgsql-hackers(at)postgreSQL(dot)org, Jan Wieck <jwieck(at)debis(dot)com>
Subject: Re: [HACKERS] VIEW definitions broken in 6.5.0
Date: 1999-09-23 19:07:18
Message-ID: 199909231907.PAA23863@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Jan, or someone, can you comment on this?

> 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
>
>

--
Bruce Momjian | http://www.op.net/~candle
maillist(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 1999-09-23 19:10:19 Re: [HACKERS] pg_dump quoting bug
Previous Message Bruce Momjian 1999-09-23 17:35:51 [HACKERS] 9-key index ? (fwd)