| From: | Richard Harvey Chapman <hchapman(at)3gfp(dot)com> |
|---|---|
| To: | pgsql-general(at)postgresql(dot)org |
| Subject: | Inserting into views |
| Date: | 2000-06-28 03:00:55 |
| Message-ID: | Pine.LNX.4.10.10006271957170.14843-100000@smile.3gfp.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
Is this allowed in Postgresql?
It "appears" to work, but then doesn't.
R.
----
test=# create table liar (num integer, name varchar(20));
CREATE
test=# insert into liar values (32, 'Bill');
INSERT 31754 1
test=# insert into liar values (2, 'Joey');
INSERT 31755 1
test=# insert into liar values (6, 'Felicia');
INSERT 31756 1
test=# select * from liar;
num | name
-----+---------
32 | Bill
2 | Joey
6 | Felicia
(3 rows)
test=# create view liar_view as select num, name, num as fodder from liar;
CREATE 31768 1
test=# SELECT * from liar_view ;
num | name | fodder
-----+---------+--------
32 | Bill | 32
2 | Joey | 2
6 | Felicia | 6
(3 rows)
test=# insert into liar_view (num, name) values (43, 'Jane');
INSERT 31769 1
test=# SELECT * from liar_view ;
num | name | fodder
-----+---------+--------
32 | Bill | 32
2 | Joey | 2
6 | Felicia | 6
(3 rows)
test=# select * from liar;
num | name
-----+---------
32 | Bill
2 | Joey
6 | Felicia
(3 rows)
test=# insert into liar_view (num, name, fodder) values (43, 'Jane', 43);
INSERT 31770 1
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Howard | 2000-06-28 03:29:28 | Connecting postgreSQL using JDBC |
| Previous Message | Richard Harvey Chapman | 2000-06-28 01:59:18 | Re: Re: PostgreSQL General Digest V1 #266 |