Postgresql Insert From Query Sql Running Number