Re: Feature request: support queries with returning on simple views with automatic update

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Feature request: support queries with returning on simple views with automatic update
Дата
Msg-id CAB7nPqRuVz58tQeSM8PyD8hcg7tpqSwObNH_mt1h7WR92Bou-g@mail.gmail.com
обсуждение исходный текст
Ответ на Feature request: support queries with returning on simple views with automatic update  (Attila Soki <atiware@gmx.net>)
Список pgsql-general
> it would be great if i could simply write 'insert into simple_view returning col1' or 'insert into simple_view
returningcol2' and postgres would make the magic behind. 
You can do it with 9.3~ servers already. Here is an example:
=# create table aa (a int);
CREATE TABLE
=# insert into aa values (1);
INSERT 0 1
=# create view aav as select * from aa;
CREATE VIEW
=# insert into aav values (2) returning a;
 a
---
 2
(1 row)
INSERT 0 1
=# delete from aav where a = 1 returning a;
 a
---
 1
(1 row)
DELETE 1

Regards,
--
Michael


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

Предыдущее
От: hiroyuki shiga
Дата:
Сообщение: postgresql9.1.6 core dump
Следующее
От: Tom Lane
Дата:
Сообщение: Re: postgresql9.1.6 core dump