Created
December 16, 2016 04:57
-
-
Save NikolayS/61be5662e76277385234e3857436d5a8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create table multi(id bigserial primary key, data text); | |
create table multi1(instance int2 not null default 1) inherits(multi); | |
create rule domultiply as on insert to multi do instead insert into multi1(data) values('auto1'), ('auto2') returning id, data; | |
insert into multi(data) values('manual') returning *; -- returns 2 rows! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment