I can use a RULE for bulk inserts into partitioned tables. For that I used something like
DO INSTEAD
INSERT INTO child_table (col1, col2)
VALUES (NEW.col1, NEW.col2)
From the RULES docs:
command
The command or commands that make up the rule action. Valid commands are SELECT, INSERT, UPDATE, DELETE, or NOTIFY.
How do I write something like?
DO ALSO
INSERT INTO agg_table (col1, agg_col)
VALUES (NEW.col1, AVG(NEW.col2))
GROUP BY NEW.col1
Which gives me a syntax error at GROUP