fixes bug 974726 - implement correlations using postgres