postgresql - ERROR: missing data for column when using \copy in psql -


I am trying to import a .txt file into PostgreSQL. There are 6 columns in the txt file:

  lab_name lab_ID feature ZIP_Code city state  

and 213 rows.

I am trying to use \ copy to use this command in PostgreSQL in a table called doe2 . :

  \ copy DOE2 FROM '/users/nathangroom/desktop/DOE_inventory5.txt' (DELIMITER (''))  

This gives me this error

I have to do this while facing this error and some

Three possible reasons:

  1. One or more rows of burnt file only 4 or less space characters (your delimiters).

  2. One or more space characters have survived (inadvertently) possibly with a backslash at the end of an unconditional value. Using the text format (default) you can cite the COPY / code> data characters For data which can otherwise be taken as line or column delimiter.

    Nobody will perform but will your file be edited or is it from a different, faulty source?

    1. You are not using the file you looks you are using \ copy Meta The command's psql command line interface is a wrapper for COPY and reads the file locally on the client . If your file stays on the server, then use the SQL command instead.

Comments

Popular posts from this blog

HTML/CSS - Automatically set height width from background image? -

php - Mysql Show Process - Sleep Commands and what to do -

c - What is the address of buf (the local variable in the main function)? -