Table Partitioning Query In Postgresql