use a hook for the changes to psql