updated exit file in pgSQL