add pivot function to postgres source.

This enable the `unstack` function on dataframe, which enabled
stacked vega chart.