

It means the first row of your CSV file isn't a header, listing the names of the columns. I assume this isn't a literal copy-and-paste from a SQLite command session, else later parts of your explanation wouldn't be working, which then leads me to ask, why are you posting commands here that differ from what you're actually typing? Why make us second-guess your description in order to make any sense of it? Why are you putting a space between the "c:" bit and the rest of the path? That's two paths, the first meaning "the current working directory on the C drive". import c: /users/inspiron/desktop/people2012.csv Sqlite> select * from people2012 limit 10


However, when specifying the base, there is no value in the columns. So, as the procedure didn't work, I tried to create the table first (with the columns separated by a comma):Ĭ: /users/inspiron/desktop/pessoas2012.csv:11: expected 120 columns but found 1 - filling the rest with NULL import c: /users/inspiron/desktop/people2012.csv people2012ĬREATE TABLE people2012 (.) failed: duplicate column name: I am using the following command to import this database: I already checked DataGrip documentation on Import/Export but couldn't find what I was looking for.I have a base with 81,372,577 observations and whose columns are separated by semicolons. How can I make DataGrip understand that Ford is a value of the brand enum? I tried to specify Ford::brand in my csv and reload and got the same issue. If I select the option Insert inconvertible values as Null while checking the DataGrip import option, I got a more verbose error message: 2:1: ERROR: column "manufacturer" is of type brand but expression is of type character varying Hint: You will need to rewrite or cast the expression. Then an error message is generated: 2:3: conversion failed: "Ford" to brand I select the right encoding option and click OK. The csv file I select for import contains the following 2 lines: id, manufacturer, registration_number, owner Now I try to import data from a csv file by right-clicking on my table and selecting Import data from File.

CREATE TABLE automobile (Īnd insert some dummy records into it: INSERT INTO automobile (id, manufacturer, registration_number, owner) I create a dummy table with a manufacturer column being of type brand. You can check you have declared an enum type with: SELECT enum_range(NULL::brand) Reproduction steps CREATE TYPE brand AS ENUM ('BMW', 'Renault', 'Ford') I guess I have to explicitly cast the string as being of brand type but how can I do this? I don't see any options of this kind in the import options. Yet in the following screenshot we can see that the manufacturer column is filled with the expected string value : Ford. When I try to import records from a csv file with DataGrip built-in feature I got an error message: conversion failed: "Ford" to brand One of my field is a custom enum - let's call it brand. I want to insert data from a csv file into an existing table on a PostgreSQL database - let's call the table automobile.
