Importing CSV file PostgreSQL using pgAdmin 4

30,459

You can use Import/Export option for this task.

  1. Right click on your table
  2. Select "Import/Export" option & Click
  3. Provide proper option
  4. Click Ok button

enter image description here

enter image description here

Share:
30,459
Slotmachine
Author by

Slotmachine

Updated on July 09, 2022

Comments

  • Slotmachine
    Slotmachine almost 2 years

    I'm trying to import a CSV file to my PostgreSQL but I get this error

    ERROR:  invalid input syntax for integer: "id;date;time;latitude;longitude"
    CONTEXT:  COPY test, line 1, column id: "id;date;time;latitude;longitude"
    

    my csv file is simple

    id;date;time;latitude;longitude
    12980;2015-10-22;14:13:44.1430000;59,86411203;17,64274849
    

    The table is created with the following code:

    CREATE TABLE kordinater.test
    (
        id integer NOT NULL,
        date date,
        "time" time without time zone,
        latitude real,
        longitude real
    )
    WITH (
        OIDS = FALSE
    )
    TABLESPACE pg_default;
    
    ALTER TABLE kordinater.test
        OWNER to postgres;