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

Поиск
Список
Период
Сортировка
От Joe Conway
Тема Re: What is the point of create or replace view command
Дата
Msg-id 4483C520.9010909@joeconway.com
обсуждение исходный текст
Ответ на Re: What is the point of create or replace view command  ("Chris Velevitch" <chris.velevitch@gmail.com>)
Ответы Re: What is the point of create or replace view command  ("Chris Velevitch" <chris.velevitch@gmail.com>)
Список 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


В списке pgsql-general по дате отправления:

Предыдущее
От: "Chris Velevitch"
Дата:
Сообщение: Re: What is the point of create or replace view command
Следующее
От: Frank Finner
Дата:
Сообщение: Re: 8.1.4: Installation ends up in endless recheck loops