Postgresql While Loop Insert In Sql