fix for postgres > 9.2