keep tracks in postgresql