AW: ask for help !!! (emergency case)

From: Zeugswetter Andreas SB <ZeugswetterA(at)wien(dot)spardat(dot)at>
To: "'Jaruwan Laongmal'" <jaruwan(at)gits(dot)net(dot)th>, pgsql-hackers(at)postgresql(dot)org, pgsql-sql(at)postgresql(dot)org
Subject: AW: ask for help !!! (emergency case)
Date: 2001-02-23 11:19:49
Message-ID: 11C1E6749A55D411A9670001FA68796336820B@sdexcsrv1.f000.d0188.sd.spardat.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-sql


> I hava 2 problems about view
> 1. i can't insert into view

> I try to insert into view as following
> create table t1 (id int,name varchar(12) check(id<=10));
> create table t2 (id int,name varchar(12) check(id>10));
> create view v1 as select * from t1,t2;

This is not an updateable view in any database product.
It is a cartesian product join of t1 and t2.

You probably wanted:
create view v1 as
select * from t1
union all
select * from t2;

> insert into v1 values(1,'wan1');
> insert into v1 values(12,'wan12');
>
> it does not show any problem but it doen't have data in table
> t1 and table t2

Version 7.1 will give you an error if you don't create an appropriate
insert and update rule for the view.

Insert and update rules are not yet automatically created for views.

Andreas

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dmitry Morozovsky 2001-02-23 11:56:41 Re: [HACKERS] Re: v7.1b4 bad performance
Previous Message Jaruwan Laongmal 2001-02-23 11:14:34 ask for help !!! (emergency case)

Browse pgsql-sql by date

  From Date Subject
Next Message Mathijs Brands 2001-02-23 14:42:44 Re: Speed of SQL statements
Previous Message Jaume Teixi 2001-02-23 11:18:31