imperialwicket/postgresql-time-series-table-partitions — pull request #4 by EliSnow (2014-12-09 17:38:03+00:00)
Title: Fixed bug in trigger

Here's my retry for #3. Fixed the bug in the trigger.

Simplified the parameters to do the same thing in 6 parameters that needed 9 parameters before.

The `primary_table` parameter is of type `regclass` and the child tables will use the same schema and table owner as the parent table. The `date` column can now accept an expression which returns a timestamp in addition to a column name. This is necessary to partition on dates derived from hstore or jsonb columns, for example. If the expression contains characters which cannot be included in an identifier, the text `date` is used where the column name was previously used (ie, trigger names).

`plan` and `step` parameters are combined into one parameter, `spacing`, of the `interval` data type. The date format used in child table names is derived from the interval. `1 day` is the minimum granularity supported.

Additionally, as a style preference, I normalized the spacing around assignment operators (`:=`). Made a few other minor formatting changes for consistency.

Similar changes could be made to the `update_partitions.sql`, but I didn't need that file so I only changed this one.