0

I am having multiple of csv.gz files in local computer which I want to upload into postgres table without unzipping the file. I had refer to this questions (Loading zipped CSV(filename.csv.gz) file into PostgreSQL table) and used this query

\COPY TABLE FROM PROGRAM 'gzip -dc my_file.csv.gz' DELIMITER ',' CSV HEADER NULL;

when I run it on sql shell it shown this notification "gzip is not recognized as an internal or external command". Could anyone suggest me how to do it correctly

reyalino
  • 157
  • 1
  • 1
  • 5
  • 3
    Then download and install gzip, e.g. from [here](http://gnuwin32.sourceforge.net/packages.html) or [here](http://unxutils.sourceforge.net/) or [here](https://github.com/bmatzelle/gow/tree/master/bin) –  Dec 10 '19 at 07:45
  • 1
    Or if you will be doing things like this a lot, install cygwin, which will give you gzip and a lot of other linux-typical tools which would be tedious to install one by one. – jjanes Dec 10 '19 at 12:28
  • It work after install gzip and setting up into environment path..thanks @a_horse_with_no_name – reyalino Dec 13 '19 at 01:54

0 Answers0