postgresql select from partitioned table