-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.
  • 17,862
  • 6
  • 63
  • 80
urjit on rails
  • 1,523
  • 4
  • 17
  • 34

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
  • 283,586
  • 65
  • 635
  • 730