Initial version of PostgreSQL plugin

This patch implements a first version of a PostgreSQL plugin. Currently there is no support for user defined queries.