Pgadmin4: Importing A Csv
I am trying to import a CSV using pgAdmin4. I created the table using the query, CREATE TABLE i210_2017_02_18 ( PROBE_ID character varying(255), SAMPLE_DATE timestamp without t
Solution 1:
According to your table structure, this import will fail in the columns HEADING and SPEED, since their values have decimals and you declared them as INTEGER. Either remove the decimals or change the column type to e.g. NUMERIC.
Having said that, just try this from pgAdmin (considering that file and database are in the same server):
COPY i210_2017_02_18 FROM'/home/jones/file.csv' CSV HEADER;
In case you're dealing with a remote server, try this using psql from your console:
$ cat file.csv | psql yourdb -c "COPY i210_2017_02_18 FROM STDIN CSV HEADER;"You can also check this answer.
In case you really want to stick to the pgAdmin import tool, which I discourage, just select the Header option and the proper Delimiter:
Solution 2:
Have you set the Header-Option = TRUE? Import settings
that should work.

Post a Comment for "Pgadmin4: Importing A Csv"