fix for different postgre versions