further postgre compatibility fixes