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

3
  • 3
    Then download and install gzip, e.g. from here or here or here Commented Dec 10, 2019 at 7: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. Commented Dec 10, 2019 at 12:28
  • It work after install gzip and setting up into environment path..thanks @a_horse_with_no_name Commented Dec 13, 2019 at 1:54

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.