fix pg-sync and test