More DB functions.
Template for PostgreSQL statistic writer.