Table partitioning

This is complete as far as I can tell, for both MySQL and PostgreSQL