PostgreSQL version for updating log table