limitations of views?

From: Brook Milligan <brook(at)trillium(dot)NMSU(dot)Edu>
To: pgsql-sql(at)postgresql(dot)org
Subject: limitations of views?
Date: 1998-07-15 17:21:35
Message-ID: 199807151721.LAA10781@trillium.nmsu.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

I would like to use views and allow updates. What are the postgresql
limitations imposed on views that restrict updates?

I tried the following and could not update the view, but would like
something more concrete about what the actual limiatations are.

Thanks for your help.

Cheers,
Brook

===========================================================================
drop table view_table_1;
create table view_table_1 (id int, name text);
drop table view_table_2;
create table view_table_2 (id int, telephone text);
drop table view_table_3;
create table view_table_3 (name_id int, phone_id int);
insert into view_table_1 (id, name) values (1, 'tom');
insert into view_table_1 (id, name) values (2, 'mary');
insert into view_table_2 (id, telephone) values (1, '555-1212');
insert into view_table_2 (id, telephone) values (2, '(505) 555-1212');
insert into view_table_3 (name_id, phone_id) values (1, 1);
insert into view_table_3 (name_id, phone_id) values (2, 2);
select * from view_table_1;
select * from view_table_2;
select * from view_table_3;
drop view view_table;
create view view_table as select names.name, phones.telephone
from view_table_1 names, view_table_2 phones
where names.id = view_table_3.name_id
and phones.id = view_table_3.phone_id;
select * from view_table;
-- update fails
update view_table set telephone = '505-555-1212';
select * from view_table;

Browse pgsql-sql by date

  From Date Subject
Next Message Jackson, DeJuan 1998-07-15 17:43:46 RE: [SQL] Typecasting in SQL functions
Previous Message Sejin Oh 1998-07-15 06:34:13 Re: [SQL] Finding strings inside a field...