postgres: orrect correctly database changes