Dashboard with PostgreSQL support

These commits contain changes that enable dashboard to work on PostgreSQL.