0

I have 5 CSV files and would like to query those using PostgreSQL.

Is there an easy method to create a new PostgreSQL table from each of these CSV files?

I'm a beginner with PostgreSQL, I just installed v9.6 on my Windows machine.

Thanks

Pierre
  • 43
  • 1
  • 6
  • Hi Klin, I have an error message saying I don't have the permission when I follow the'import' step from your message in the other post. The csv isn't on read only and doesn't seem to have any restrictions... are you able to assist further? Thanks – Pierre Feb 13 '17 at 16:52
  • the error message is the following: ERROR: could not open file "C:\Users\Pierre\Desktop\sql-test-database\calls.csv" for reading: Permission denied CONTEXT: SQL statement "copy import from E'C:\\Users\\Pierre\\Desktop\\sql-test-database\\calls.csv'" PL/pgSQL function import_csv(text,text) line 4 at EXECUTE – Pierre Feb 13 '17 at 17:07
  • The folder with csv files has to be reachable by the user who owns Postgres, typically the user's name is `postgres`. In other words, o.s. user `postgres` must have read access to your csv files. – klin Feb 13 '17 at 17:47
  • thank you very much Klin it works - it took me 10 hours to figure this out... – Pierre Feb 13 '17 at 18:29

0 Answers0