Inserting into views

Поиск
Список
Период
Сортировка
От Richard Harvey Chapman
Тема Inserting into views
Дата
Msg-id Pine.LNX.4.10.10006271957170.14843-100000@smile.3gfp.com
обсуждение исходный текст
Ответы Re: Inserting into views
Список 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


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

Предыдущее
От: Richard Harvey Chapman
Дата:
Сообщение: Re: Re: PostgreSQL General Digest V1 #266
Следующее
От: "Howard"
Дата:
Сообщение: Connecting postgreSQL using JDBC