pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedAW: ask for help !!! (emergency case)
2+ messages / 2 participants
[nested] [flat]
* AW: ask for help !!! (emergency case)
@ 2001-02-23 11:19 Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>
0 siblings, 1 reply; 2+ messages in thread
From: Zeugswetter Andreas SB @ 2001-02-23 11:19 UTC (permalink / raw)
To: 'Jaruwan Laongmal' <jaruwan@gits.net.th>; pgsql-hackers@postgresql.org; 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
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: AW: ask for help !!! (emergency case)
@ 2001-02-23 15:41 Tom Lane <tgl@sss.pgh.pa.us>
parent: Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>
0 siblings, 0 replies; 2+ messages in thread
From: Tom Lane @ 2001-02-23 15:41 UTC (permalink / raw)
To: Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>; +Cc: 'Jaruwan Laongmal' <jaruwan@gits.net.th>; pgsql-hackers@postgresql.org; pgsql-sql
Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at> writes:
> You probably wanted:
> create view v1 as
> select * from t1
> union all
> select * from t2;
Probably, but we don't support UNION in views before 7.1 :-(
I'm not real clear on why t1 and t2 are separate tables at all in this
example. Seems like making v1 be the real table, and t1 and t2 be
selective views of it, would work a lot easier.
regards, tom lane
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2001-02-23 15:41 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2001-02-23 11:19 AW: ask for help !!! (emergency case) Zeugswetter Andreas SB <ZeugswetterA@wien.spardat.at>
2001-02-23 15:41 ` Re: AW: ask for help !!! (emergency case) Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox