Forum: Ruby on Rails RE: Rails - Postgres - importing data

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Nathan L. (Guest)
on 2006-05-30 19:53
(Received via mailing list)

I would just use the following command from within the Postgres command

"copy tablename from '/dir/filename';"

It works well and is fast for even large amounts of data.  Your file
should have the contents in the same order as the columns in your table
and can be delimited with any character as long as you specify it as
part of the command.  I believe the default is tab-delimited.  See "\h
copy" from within the Postgres prompt for more details.

Hope this helps.

This topic is locked and can not be replied to.