Re: Apparent anomaly with views and unions - Mailing list pgsql-general

From Stephan Szabo
Subject Re: Apparent anomaly with views and unions
Date
Msg-id 20050211163540.G90218@megazone.bigpanda.com
Whole thread Raw
In response to Apparent anomaly with views and unions  ("Guy Rouillier" <guyr@masergy.com>)
Responses Re: Apparent anomaly with views and unions
List pgsql-general
On Fri, 11 Feb 2005, Guy Rouillier wrote:

> I using 8.0.1.  I create 3 tables with these definitions:
>
> create table t1 (serv_id varchar(50) not null);
> create table t2 (serv_id varchar(50) not null);
> create table t3 (serv_id varchar(50) not null);
>
> Now I create a view like this:
>
> create or replace view v1 as select * from t1;
>
> Next, I attempt to update this view like this:
> create or replace view v1 as select * from t1 union select * from t2;
>
> I receive: ERROR:  cannot change data type of view column "serv_id"

I'm pretty sure PostgreSQL treats the type of serv_id in the new view as
varchar with no limit rather than varchar(50). I think that's also not
entirely up to spec.

In the two to three case it already was a varchar with no limit and so the
type was the same.

pgsql-general by date:

Previous
From: "David Parker"
Date:
Subject: Re: file descriptors
Next
From: Tom Lane
Date:
Subject: Re: databases/p5-postgresql-plperl links to wrong