Re: Feature request: support queries with returning on simple views with automatic update - Mailing list pgsql-general

From Michael Paquier
Subject Re: Feature request: support queries with returning on simple views with automatic update
Date
Msg-id CAB7nPqRuVz58tQeSM8PyD8hcg7tpqSwObNH_mt1h7WR92Bou-g@mail.gmail.com
Whole thread Raw
In response to Feature request: support queries with returning on simple views with automatic update  (Attila Soki <atiware@gmx.net>)
List 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 by date:

Previous
From: hiroyuki shiga
Date:
Subject: postgresql9.1.6 core dump
Next
From: Tom Lane
Date:
Subject: Re: postgresql9.1.6 core dump