Fix postresql implementation