On Mar 20, 2012, at 8:49 PM, Tim Uckun wrote:
I have done some googling to try and figure out how I can use COPY
FROM STDIN with rails and have ran into some posts on stackoverflow or
the mailing list but none of them seem to be working with rails 3.2
Does anybody have a working example of
conn = ActiveRecord::Base.connection_pool.checkout
raw = conn.raw_connection
raw.exec(COPY tablename (col1, col2, col3) FROM STDIN)
# open up your CSV file looping through line by line and getting the line
into a format suitable for pg's COPY...
rc.put_copy_data line
# once all done...
I have done some googling to try and figure out how I can use COPY
FROM STDIN with rails and have ran into some posts on stackoverflow or
the mailing list but none of them seem to be working with rails 3.2
Does anybody have a working example of using COPY FROM STDIN?
Some things I have tried
3 matches
Mail list logo