Ad-hoc queries and charting of Postgres databases