Importing zipped CSV file into PostgreSQL

后端 未结 3 480
忘了有多久
忘了有多久 2020-12-06 00:46

I have a big compressed csv file (25gb) and I want to import it into PostgreSQL 9.5 version. Is there any fast way to import zip or qzip file into postgres without extractin

3条回答
  •  旧巷少年郎
    2020-12-06 01:27

    If you have a ZIP (.zip) instead of a GZIP (.gz) archive, you can use unzip -p to pipe the zipped file.

    psql -p 5555 t -c "copy tp from program 'unzip -p /tmp/tp.csv.zip';"
    

提交回复
热议问题