我试图运行一系列postgres函数/存储过程并行使用bash + psql在单独的表上运行,如下所示:
psql -d samples_20160612_0616 -c "select insert_function('2016-6-14 20:00'::timestamp, '2016-6-14 21:00'::timestamp)" & psql -d samples_20160612_0616 -c "select insert_function('2016-6-15 19:00'::timestamp, '2016-6-15 20:00'::timestamp)" & psql -d samples_20160612_0616 -c "select insert_function('2016-6-15 20:00'::timestamp, '2016-6-15 21:00'::timestamp)" & psql -d samples_20160612_0616 -c "select insert_function('2016-6-16 19:00'::timestamp, '2016-6-16 20:00'::timestamp)" & psql -d samples_20160612_0616 -c "select insert_function('2016-6-16 20:00'::timestamp, '2016-6-16 21:00'::timestamp)"
出于某种原因,似乎并不像预期的那样并行运行,这些语句是连续运行的。
我在这里做错了什么? 不应该这样并行吗?