Re: What is the point of create or replace view command

From: Joe Conway <mail(at)joeconway(dot)com>
To: Chris Velevitch <chris(dot)velevitch(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: What is the point of create or replace view command
Date: 2006-06-05 05:46:08
Message-ID: 4483C520.9010909@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Chris Velevitch wrote:
> But what about my original question?
>
> "What is the point of the create or replace view command if you
> can't change the
> column and data types?"

-- create table t1
create table t1(f int);
-- create view v1 based on table t1
create view v1 as select * from t1;
-- create view v2 based on view v1
create view v2 as select * from v1;
-- attempt to drop and recreate view v1 with a WHERE clause
drop view v1;
-- attempt to create or replace view v1 with a WHERE clause
create or replace view v1 as select * from t1 where 1 = 1;
-- attempt to create or replace view v1 with a different WHERE clause
create or replace view v1 as select * from t1 where 1 = 2;

HTH,

Joe

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Frank Finner 2006-06-05 06:12:57 Re: 8.1.4: Installation ends up in endless recheck loops
Previous Message Chris Velevitch 2006-06-05 05:21:38 Re: What is the point of create or replace view command