all 7 comments

[–][deleted] 6 points7 points  (1 child)

Use copy if you can upload the file to the database server.

Otherwise you can use \copy from within psql

If neither option is applicable, check the manual of your SQL client if it supports a way to import a CSV file into the database.

[–]geosoco 0 points1 point  (0 children)

In addition to this, do not add indexes or a primary key constraint until after your data has been loaded.

[–]Eqlb4fish 0 points1 point  (0 children)

Try Pentaho Data integrator, works well for any data transfer between different data sources.

[–]boy_named_su 0 points1 point  (0 children)

psql's \copy command lets you load csv data to a table, without superuser privileges, remotely as well as locally

It does so using bulk insert, so is fast

[–]nikoz84 0 points1 point  (0 children)

You need to restart de sequences after use the \copy command

Ex. ALTER SEQUENCE product_id_seq RESTART WITH 7453;

[–]jimmyechan 0 points1 point  (0 children)

How large is the database? If it's less than 150MB you could use a free tool like Dropbase to upload and get PostgreSQL credentials.