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, PerlText::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
Related Posts:
- PostgreSQL: Show tables in PostgreSQL
- Psql could not connect to server: No such file or directory, 5432 error?
- Getting error: Peer authentication failed for user “postgres”, when trying to get pgsql working with rails
- What is the format for the PostgreSQL connection string / URL?
- “use database_name” command in PostgreSQL
- PSQLException: current transaction is aborted, commands ignored until end of transaction block
- psql: FATAL: Ident authentication failed for user “postgres”
- fe_sendauth: no password supplied
- How can I import an Excel file into SQL Server?
- How can I drop all the tables in a PostgreSQL database?
- How to restart PostgreSQL in Ubuntu 18.04
- FATAL: password authentication failed for user “postgres” (postgresql 11 with pgAdmin 4)
- Postgresql: Scripting psql execution with password
- postgresql duplicate key violates unique constraint
- “psql: could not connect to server: Connection refused” Error when connecting to remote database
- How to change PostgreSQL user password?
- No function matches the given name and argument types
- PostgreSQL error: Fatal: role “username” does not exist
- “extra data after last expected column” while trying to import a csv file into postgresql
- How to change PostgreSQL user password?
- How to exit from PostgreSQL command line utility: psql
- psql: FATAL: database “
” does not exist - eroku “psql: FATAL: remaining connection slots are reserved for non-replication superuser connections”
- Permission denied for relation
- postgres does not know where to find server configuration
- input file appears to be a text format dump. Please use psql
- Postgres: INSERT if does not exist already
- How to import CSV into Custom Post Type custom fields?
- CSV syntax for WP All Import upload without ACF
- Importing CSV into database table not working?
- How to handle a CSV with 65,000+ rows and make it searchable?
- Huge category CSV import does not work
- Feed format for woocommerce [closed]
- What’s the fastest way to import products with variations in WooCommerce (CSV, XML, …) [closed]
- Create a form with custom autocomplete address field and CSV import values
- Undo WooCommerce CSV import
- Import user data using CSV
- Import users once a day without a plugin
- CSV to WordPress posts: do I have to populate each possible field?
- best way to upload a large file to wordpress using wp all import
- Upload advanced custom field text link array with csv
- Pull specific data from CSV
- Creating connections programmatically with common fields on CPT’s
- How to cdv from a custom CMS to WP
- Create CSV for import from File directories?
- What’s the default superuser username/password for postgres after a new install?
- How to see active connections and “current activity” in PostgreSQL 8.4
- pg_dump and pg_restore: input file does not appear to be a valid archive
- Creating posts with php-script + csv
- Import Error: No module named numpy
- Dump a NumPy array into a csv file
- How to deep copy a list?
- python csv2libsvm.py: AttributeError: ‘_csv.reader’ object has no attribute ‘next’
- PostgreSQL: Query has no destination for result data
- Python name ‘os’ is not defined
- Python CSV Error: sequence expected
- How to copy a row and insert in same table with a autoincrement field in MySQL?
- Is there a function to make a copy of a PHP array to another?
- Python copy files to a new directory and rename if file name already exists
- WordPress WXR Specification
- How to export and import taxonomies (category, tag and/or custom taxonomy) and their terms
- When importing – failed to import: Invalid post type feedback
- Why doesn’t the WordPress Importer update posts?
- When importing database, it shows error
- Download/View Schema (or DTD) for XML Import
- Exporting just posts of a specific category
- Convert a static website to a WordPress theme and import all existing content
- Is a direct or import approach safer for migration into WordPress?
- Import menu tree to custom menu from csv or xml, many nested menu points
- How to import only certain comments from post[s]
- Image File Names
- can’t import xml file
- Unknown collation when I import a dump from an existing site into a development database?
- Tags not importing when using WordPress import system
- Error: Failed to import tag/post
- Update Attached Image Size after Import
- How to retrieve current wordpress profile page URL?
- How to upload a file from WP directory automatically?
- How to import content from WordPress.com to a self hosted WordPress installation?
- WordPress pages creation work distribution & then combining – Localhost XAMPP
- After imorting posts from another blog double line breaks have been replaced with single line breaks
- Convert bookmarks.html file into WP posts
- Which is the correct way to migrate content from single WP to WP multisite
- Migration problems with mysql: Operation not allowed when innodb_forced_recovery > 0 [closed]
- Attachments broken after giving WordPress its own directory
- How to import media from folder as opposed from old site?
- Import Recent Posts Only and Ignore old ones if exist
- Import from Windows to Linux
- How do I export categories, site stats, comments and posts from wordpress to excel
- How to import products to Woo Commerce given that WP All Import keeps timing out
- Trouble migrating custom post types from non-wordpress cms
- Products aren’t detected if CSV importer are used
- Button to download export data WordPress in CSV file
- Migrate site from WordPress multisite to another WordPress multisite
- Function to get the name in database table from the comma separated string
- I would like to import two columns into WordPress
- How to export tag counts to excel?
- How to let ‘cp’ command don’t fire an error when source file does not exist?
- Postgres equivalent to MySQL’s \G?
- Programmatically creating posts based on external JSON feed (asynchronously)