Skip to content
Prev 9006 / 398502 Next

Huge memory comsumption with foreign and RPgSQL

I usually import directly into postgresql first and then read the data 
using rpgsql.  In psql, create a table, e.g.,

   create table my_table (col1 int, col2 float, ...)

then format your data as a tab-separated ascii file, one column per 
variable.  In psql,

   \copy my_table from 'filename'

or

   \g copy my_table from 'filename' using delimiters 'delim' with null 
as 'null string'

Once the data are in postgresql, fire up R and read the tables with rpgsql.

Tim
Peter Dalgaard BSA wrote: