-1

I want to upload 3 GB csv file to the pg database on server.

I need to finish this operation in 4 to 5 hours.

Please show me the way to upload data to server from csv file.

Vivek S.
  • 19,945
  • 7
  • 68
  • 85
urjit on rails
  • 1,763
  • 4
  • 19
  • 36

1 Answers1

0

If you can take the DB offline, copy the file to the server with (e.g.) scp, then use pg_bulkload.

Otherwise split it into chunks and use psql's \copy to load the chunks in parallel, after dropping indexes etc.

See also:

Community
  • 1
  • 1
Craig Ringer
  • 307,061
  • 76
  • 688
  • 778