title: Getting this error: (psycopg2.errors.NumericValueOutOfRange) integer out of range but not inserting a Bigint
body: <p>I am inserting data via sqlalchemy into a postgres database, which contains NHL data. Other records seem to have no problem just when inserting a certain players. Here is the full error: </p>
  
  <pre><code>[SQL: INSERT INTO career_basic_stats (player_id, player_name, season, age, team_id, lg_id, games_played, goals, assists, points, plus_minus, pen_min, goals_ev, goals_pp, goals_sh, goals_gw, assists_ev, assists_pp, assists_sh, shots, shot_pct, shots_attempted, time_on_ice, time_on_ice_avg, faceoff_wins, faceoff_losses, faceoff_percentage, blocks, hits, takeaways, giveaways, award_summary) VALUES (%(player_id)s, %(player_name)s, %(season)s, %(age)s, %(team_id)s, %(lg_id)s, %(games_played)s, %(goals)s, %(assists)s, %(points)s, %(plus_minus)s, %(pen_min)s, %(goals_ev)s, %(goals_pp)s, %(goals_sh)s, %(goals_gw)s, %(assists_ev)s, %(assists_pp)s, %(assists_sh)s, %(shots)s, %(shot_pct)s, %(shots_attempted)s, %(time_on_ice)s, %(time_on_ice_avg)s, %(faceoff_wins)s, %(faceoff_losses)s, %(faceoff_percentage)s, %(blocks)s, %(hits)s, %(takeaways)s, %(giveaways)s, %(award_summary)s) RETURNING career_basic_stats.id]
  [parameters: {'player_id': 36, 'player_name': 'craig_adams', 'season': '2000-01', 'age': '23', 'team_id': 'CAR', 'lg_id': 'NHL', 'games_played': '44', 'goals': '1', 'assists': '0', 'points': '1', 'plus_minus': '-7', 'pen_min': '20', 'goals_ev': '1', 'goals_pp': '0', 'goals_sh': '0', 'goals_gw': '0', 'assists_ev': '0', 'assists_pp': '0', 'assists_sh': '0', 'shots': '15', 'shot_pct': '6.7', 'shots_attempted': nan, 'time_on_ice': '198', 'time_on_ice_avg': '4:30', 'faceoff_wins': nan, 'faceoff_losses': nan, 'faceoff_percentage': nan, 'blocks': nan, 'hits': nan, 'takeaways': nan, 'giveaways': nan, 'award_summary': nan}]
  (Background on this error at: http://sqlalche.me/e/9h9h)
  </code></pre>
  
  <p>Here is the database Model I am using:</p>
  
  <pre><code>class BasicCareerStats(Base):
      __tablename__ = "career_basic_stats"
      metadata = sqlalchemy.MetaData()
  
      id = Column(Integer, autoincrement=True, primary_key=True)
      player_id = Column(Integer, nullable=False)
      player_name = Column(String, nullable=False)
      season = Column(String, nullable=False)
      age = Column(Integer, nullable=False)
      team_id = Column(String, nullable=False)
      lg_id = Column(String, nullable=False)
      games_played = Column(Integer, nullable=False)
      goals = Column(Integer, nullable=False)
      assists = Column(Integer, nullable=False)
      points = Column(Integer, nullable=False)
      plus_minus = Column(Integer, nullable=False)
      pen_min = Column(Integer, nullable=False)
      goals_ev = Column(Integer, nullable=False)
      goals_pp = Column(Integer, nullable=False)
      goals_sh = Column(Integer, nullable=False)
      goals_gw = Column(Integer, nullable=False)
      assists_ev = Column(Integer, nullable=False)
      assists_pp = Column(Integer, nullable=False)
      assists_sh = Column(Integer, nullable=False)
      shots = Column(Integer, nullable=False)
      shot_pct = Column(Float, nullable=False)
      shots_attempted = Column(Integer, nullable=True)
      time_on_ice = Column(Integer, nullable=True)
      time_on_ice_avg = Column(String, nullable=True)
      faceoff_wins = Column(Integer, nullable=True)
      faceoff_losses = Column(Integer, nullable=True)
      faceoff_percentage = Column(Float, nullable=True)
      blocks = Column(Integer, nullable=True)
      hits = Column(Integer, nullable=True)
      takeaways = Column(Integer, nullable=True)
      giveaways = Column(Integer, nullable=True)
      award_summary = Column(String, nullable=True)
  </code></pre>
  
  <p>Here is the revelant code snippet for adding and commiting to the database.</p>
  
  <pre><code>try:
      basic_career_stats = BasicCareerStats(**record,
      player_name=self.get_player_name(player_stat_url=player_url),
                                       player_id=self.player_id)
      self.db_session.add(basic_career_stats)
      self.db_session.commit()
      self.db_session.flush()
  except Exception as e:
      self.db_session.rollback()
  
  </code></pre>