Skip to content
Permalink
Browse files

db_manager versioning: add RETURNING to INSERT rule (fixes #16083)

  • Loading branch information
jef-n committed May 16, 2017
1 parent 2f70b42 commit 3f7f95ee262ea3646d61600c21faed0866bc70b0
@@ -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,

0 comments on commit 3f7f95e

Please sign in to comment.
You can’t perform that action at this time.