Bulk Loading Numeric Columns Fails When Quotes or Apostrophes Are in The Values

When performing a bulk insert of data (COPY ... FROM) into any integer column type (tinyint, smallint, int, bigint), the insert will fail if any number value contains an apostrophe or quotes (' or ").

A typical error for this case, for an apostrophe enclosed number is 

Error parsing CSV file 'sample.csv' at location: 1:1, column 0 (int not null)
bad syntax, line is ''1.5''
  • 50
  • 26-Jul-2015
  • 587 Views