Skip to content
Permalink
Browse files

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

(cherry picked from commit 3f7f95e)
  • Loading branch information
jef-n committed May 16, 2017
1 parent fd7b52d commit 8b263e4ccb2898ababcdca3e01053fbe87e847e4
@@ -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 8b263e4

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