Skip to content

Commit

Permalink
db_manager versioning: add RETURNING to INSERT rule (fixes #16083)
Browse files Browse the repository at this point in the history
(cherry picked from commit 3f7f95e)
  • Loading branch information
jef-n committed May 16, 2017
1 parent fd7b52d commit 8b263e4
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -254,7 +254,7 @@ def sql_updatesView(self):
CREATE OR REPLACE RULE "_DELETE" AS ON DELETE TO %(view)s DO INSTEAD
DELETE FROM %(schematable)s WHERE %(origpkey)s = old.%(origpkey)s;
CREATE OR REPLACE RULE "_INSERT" AS ON INSERT TO %(view)s DO INSTEAD
INSERT INTO %(schematable)s (%(cols)s) VALUES (%(newcols)s);
INSERT INTO %(schematable)s (%(cols)s) VALUES (%(newcols)s) RETURNING %(cols)s;
CREATE OR REPLACE RULE "_UPDATE" AS ON UPDATE TO %(view)s DO INSTEAD
UPDATE %(schematable)s SET %(assign)s WHERE %(origpkey)s = NEW.%(origpkey)s;""" % {'view': self.view,
'schematable': self.schematable,
Expand Down

0 comments on commit 8b263e4

Please sign in to comment.