error: invalid input syntax for type integer: ""

ERROR: invalid input syntax for integer: ""

"" isn't a valid integer. PostgreSQL accepts unquoted blank fields as null by default in CSV, but "" would be like writing:

SELECT ''::integer;
and fail for the same reason.

If you want to deal with CSV that has things like quoted empty strings for null integers, you'll need to feed it to PostgreSQL via a pre-processor that can neaten it up a bit. PostgreSQL's CSV input doesn't understand all the weird and wonderful possible abuses of CSV.

Options include:

Loading it in a spreadsheet and exporting sane CSV;
Using the Python csv module, Perl Text::CSV, etc to pre-process it;
Using Perl/Python/whatever to load the CSV and insert it directly into the DB
Using an ETL tool like CloverETL, Talend Studio, or Pentaho Kettle

Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
invalid input syntax for type integer: "info" invalid input syntax for type integer: "5.5" invalid input syntax for type integer: \"\"" returning \"id\" - invalid input syntax for type integer ERROR: invalid input syntax for type integer: "EMPNO" invalid input syntax for type integer: "MMSI" 7 ERROR: invalid input syntax for type integer [5673] ERROR: invalid input syntax for type integer: "" at character 14678108 ERROR: invalid input syntax for type integer: "" at character 14678108 invalid input syntax for type integer: "54.0" invalid input syntax for type integer typeorm error: invalid input syntax for type integer error: invalid input syntax for type integer: "275.99" error: error: invalid input syntax for type integer: invalid input syntax for type integer: "9645.3" Error : error: invalid input syntax for type integer: Error : error: invalid input syntax for type integer: "]]" Error : error: invalid input syntax for type integer: "djskd" invalid input syntax for type integer: "{"1","2"}" invalid input syntax for type integer: "" +8272ms QueryFailedError: invalid input syntax for type integer: invalid input syntax for type integer: "" angular 8 invalid input syntax for type integer: "create" invalid input syntax for type integer: "Infinity" invalid input syntax for type integer: "{57,58,59,60,61,94,95,96}" error: invalid input syntax for type integer: "Karoleek" invalid input syntax for integer: "na" error: invalid input syntax for type integer: "PK " "invalid input syntax for type integer: \"\"" invalid input syntax for type integer: "" invalid input syntax for integer: "" Invalid operation: invalid input syntax for integer: "" ERROR: invalid input syntax for integer invalid input syntax for type integer: "questions" "invalid input syntax for type integer: \"{}\"" error: invalid input syntax for type integer: nodejs error: invalid input syntax for type integer: "viewcar" error: invalid input syntax for type integer: nodejs error: invalid input syntax for type integer: error: invalid input syntax for type integer: "buycar" invalid input syntax for type integer: invalid input syntax for type integer: "6.4" ERROR: invalid input syntax for integer: invalid input syntax for integer: "f" invalid input syntax for integer: "[object Object]" invalid input syntax for type integer invalid input syntax for integer: ERROR: invalid input syntax for type integer error: invalid input syntax for type integer: "employee_id" error invalid input syntax for integer invalid input syntax for integer Error: invalid input syntax for type integer: "[object Object]" ERROR: invalid input syntax for type integer: "style.css" ERROR: invalid input syntax for type integer: "style.css" at character 974 invalid input syntax for type integer: "6o" error: invalid input syntax for type integer: 59175.695 error: invalid input syntax for type integer: "59175.695" error: invalid input syntax for type integer: "{}" invalid input syntax for type integer: "3999.99" "ERROR: invalid input syntax for type integer: ERROR: invalid input syntax for type integer: "person_id" error: invalid input syntax for type integer: ""
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source