title: sqlalchemy.exc.DataError: (psycopg2.errors.StringDataRightTruncation) value too long for type character varying(256)
body: <p>I am trying to bulk insert using python data frame to reshift table using code below.</p>
  
  <pre><code>df.to_sql(table_name, conn, index=False, if_exists='replace')
  </code></pre>
  
  <p>It giving following error even there is no column having varchar length of 256. All string/text columns are varchar length of 65553 .</p>
  
  <pre><code>    cursor.executemany(statement, parameters)
  sqlalchemy.exc.DataError: (psycopg2.errors.StringDataRightTruncation) value too long for type character varying(256) 
  
  [SQL: INSERT INTO events_20180625_temp (event_date, event_timestamp, event_name, event_params, event_previous_timestamp, user_pseudo_id, user_properties, user_first_touch_timestamp, device, geo, app_info, traffic_source, stream_id, platform) VALUES (%(event_date)s, %(event_timestamp)s, %(event_name)s, %(event_params)s, %(event_previous_timestamp)s, %(user_pseudo_id)s, %(user_properties)s, %(user_first_touch_timestamp)s, %(device)s, %(geo)s, %(app_info)s, %(traffic_source)s, %(stream_id)s, %(platform)s)]
  [parameters: ({'event_date': '20180625', 'event_timestamp': '1529948530245005', 'event_name': 'firebase_campaign', 'event_params': '{"medium": "(not set)", "firebase_event_origin": "app", "source": "(not set)", "firebase_screen_class": "TaleEmotionTagActivity", "item_name": "NARRA ... (24 characters truncated) ... ory": "Create Post", "error_value": "Festivals Around the World_CT", "firebase_previous_class": "TrailListActivity", "previous_app_version": "3.1.0"}', 'event_previous_timestamp': '1529948527702005', 'user_pseudo_id': 'ffb01b060c860317c9baba657ffe402d', 'user_properties': '{"first_open_time": "1529172000000", "first_open_time_set_timestamp_micros": "1529171511734000"}', 'user_first_touch_timestamp': '1529948488186000', 'device': '{"category": "mobile", "mobile_brand_name": "Samsung", "mobile_model_name": "SM-A500G", "mobile_marketing_name": "Galaxy A5", "mobile_os_hardware_mod ... (83 characters truncated) ... , "advertising_id": "44f5dd05-1f78-461a-be16-f6c4b1665920", "language": "en-gb", "is_limited_ad_tracking": "No", "time_zone_offset_seconds": "19800"}', 'geo': '{"continent": "Asia", "country": "India", "region": "Gujarat", "city": "Ahmedabad"}', 'app_info': '{"id": "app.trell", "version": "3.3.8", "firebase_app_id": "1:808772988865:android:8db93cca16602100", "install_source": "com.android.vending"}', 'traffic_source': '{"name": "(direct)", "medium": "(none)", "source": "(direct)"}', 'stream_id': '1051639513', 'platform': 'ANDROID'}, {'event_date': '20180625', 'event_timestamp': '1529947540672001', 'event_name': 'firebase_campaign', 'event_params': '{"medium": "(not set)", "firebase_event_origin": "app", "source": "(not set)", "firebase_screen_class": "TaleEmotionTagActivity", "item_name": "NARRA ... (24 characters truncated) ... ory": "Create Post", "error_value": "Festivals Around the World_CT", "firebase_previous_class": "TrailListActivity", "previous_app_version": "3.1.0"}', 'event_previous_timestamp': '1529947540484001', 'user_pseudo_id': '4696ce1fc56aae5c026b2d2408bde2cd', 'user_properties': '{"first_open_time": "1529172000000", "first_open_time_set_timestamp_micros": "1529171511734000"}', 'user_first_touch_timestamp': '1529947525415000', 'device': '{"category": "mobile", "mobile_brand_name": "Samsung", "mobile_model_name": "SM-G935F", "mobile_marketing_name": "Galaxy S7 Edge", "mobile_os_hardwar ... (88 characters truncated) ... , "advertising_id": "a952abd5-952f-45de-af1f-721805044eb0", "language": "en-gb", "is_limited_ad_tracking": "No", "time_zone_offset_seconds": "19800"}', 'geo': '{"continent": "Asia", "country": "India", "region": "Maharashtra", "city": "Mumbai"}', 'app_info': '{"id": "app.trell", "version": "3.3.8", "firebase_app_id": "1:808772988865:android:8db93cca16602100", "install_source": "com.android.vending"}', 'traffic_source': '{"name": "(direct)", "medium": "(none)", "source": "(direct)"}', 'stream_id': '1051639513', 'platform': 'ANDROID'}]
  </code></pre>
  
  <p>FYI: Column description of the table I am trying to insert in.</p>
  
  <pre><code>app_info (varchar)
  Nullable: true
  Length: 65535
  Precision: 0
  device (varchar)
  Nullable: true
  Length: 65535
  Precision: 0
  event_date (varchar)
  Nullable: true
  Length: 100
  Precision: 0
  event_name (varchar)
  Nullable: true
  Length: 65535
  Precision: 0
  event_params (varchar)
  Nullable: true
  Length: 65535
  Precision: 0
  event_previous_timestamp (int8)
  Nullable: true
  Length: 19
  Precision: 0
  event_timestamp (int8)
  Nullable: true
  Length: 19
  Precision: 0
  geo (varchar)
  Nullable: true
  Length: 65535
  Precision: 0
  platform (varchar)
  Nullable: true
  Length: 65535
  Precision: 0
  stream_id (varchar)
  Nullable: true
  Length: 65535
  Precision: 0
  traffic_source (varchar)
  Nullable: true
  Length: 65535
  Precision: 0
  user_first_touch_timestamp (int8)
  Nullable: true
  Length: 19
  Precision: 0
  user_properties (varchar)
  Nullable: true
  Length: 65535
  Precision: 0
  user_pseudo_id (varchar)
  Nullable: true
  Length: 65535
  Precision: 0
  </code></pre>
  
  <p>Any leads is highly appreciated. Thanks.</p>