generate correct plan for INSERT .. SELECT .. FROM generate_series()
The planner now generates the correct plan
QUERY PLAN
---------------------------------------------------------------------------------------------
Remote Subquery Scan on all (dn1,dn2) (cost=100.00..119.00 rows=1000 width=12)
-> Insert on t1 (cost=100.00..119.00 rows=1000 width=12)
-> Remote Subquery Scan on all (dn2) (cost=100.00..119.00 rows=1000 width=12)
Distribute results by H: i
-> Function Scan on generate_series s (cost=0.00..10.00 rows=1000 width=12)
(5 rows)
for queries like
INSERT INTO t1 SELECT i, i, i FROM generate_series(1,1000) s(i);
Sadly no rows are inserted, for some reason. But the plan looks fine
(at least it seems similar to 9.5).