RE: Rails - Postgres - importing data


#1

Craig,

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

“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.

Nathan