0

The original code is a simple SQL import :

LOAD DATA LOCAL INFILE 'D:/FTP/foo/foo.csv'

INTO TABLE error_logs

FIELDS TERMINATED BY ','
ENCLOSED BY '"' 
ESCAPED BY ''
LINES STARTING BY ''
TERMINATED BY '\n' 

IGNORE 1 LINES

(Server,Client,Error,Time);

I need to migrate a web portal (from SQL to Postgres[I know there are tools for that, but its not the question]) and the issue is i am no more working on local.

I didn't see anybody ask the question in this way : import .csv from a remote server to a postgres db.

I think i have to use COPY but i dont get the right syntax...

Thanks for your attention.

B3n Sp1ndl3r
  • 35
  • 1
  • 8

1 Answers1

0

the copy command is an option to do this.

I had to do this once time.

How to import CSV file data into a PostgreSQL table?

Copying PostgreSQL database to another server

  • Thanks for the answer! Matter is i dont want to dump the db but simply import a csv from a remote server in the postgres database. – B3n Sp1ndl3r Mar 14 '18 at 08:02