This patch adds PostGres test alongside with minor fix (#1292 substitution)