How to import CSV file data into a PostgreSQL table?

前端 未结 19 2777
再見小時候
再見小時候 2020-11-22 02:14

How can I write a stored procedure that imports data from a CSV file and populates the table?

19条回答
  •  南旧
    南旧 (楼主)
    2020-11-22 03:06

    1. create a table first

    2. Then use copy command to copy the table details:

    copy table_name (C1,C2,C3....)
    from 'path to your csv file' delimiter ',' csv header;

    Thanks

提交回复
热议问题