Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> it would be great if i could simply write 'insert into simple_view returning col1' or 'insert into simple_view returning col2' 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


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux