I wrote the code below in postgresSQL to create a table;
CREATE TABLE Tryy(
Retailer varchar(45),
Retailer_ID int,
Dates date,
Months int,
Region varchar(45),
States varchar(45),
BeverageBrand varchar(45),
Price_perUnit varchar,
Unit_Sold int
);
This code runs successfully, however when I try to import the data it gives me this error.
ERROR: invalid input syntax for type integer: “Units Sold”
CONTEXT: COPY beverages, line 1, column unit_sold: “Units Sold”
This seems to be happening to all my data when I specify any other data type( Num, Int , Date) except when I use varchar. I am new to PostgreSql and I need help to go around this.
I tried this for a small amount of rows in a table and is still dont seem to work with the INT, NUM and DATE datatype.
Patrick Agyasei Donkoh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.