further corrections for postresql operation