I wrote a quick benchmarking script to test various partitioning strategies. The code is here.
https://gist.github.com/timuckun/954ab6bdce36fa14bc1c
I was astonished at the variability of the timings between the different variations. https://gist.github.com/timuckun/954ab6bdce36fa14bc1c
clean 0.000000 0.000000 0.000000 ( 3.119498)
func_1 0.000000 0.000000 0.000000 ( 7.435094)
func_2 0.000000 0.000000 0.000000 ( 28.427617)
func_3 0.000000 0.000000 0.000000 ( 18.348554)
Rule 0.000000 0.000000 0.000000 ( 2.901931)
A clean insert 3.1 seconds, putting a rule took less time!
EXECUTE 'INSERT INTO ' || quote_ident(partition_name) || ' VALUES (' || NEW.* || ')' but that gave me an error.