Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I need to insert large amounts of data into postgresql using multi-row inserts.

I am currently doing this by constructing the sql query using a stringbuilder and appending the values but I was wondering if there is a way to use commands and command parameters instead?

share|improve this question
    
Use COPY. See the npgsql manual. –  Craig Ringer Jun 4 '13 at 23:30
    
Thanks. I have already checked that and I was having problems because of the data I need to import –  dp901 Jun 5 '13 at 15:02
    
Consider COPYing to a TEMPORARY or UNLOGGED table then doing an INSERT INTO ... SELECT to insert a massaged version of the data into the real target table. –  Craig Ringer Jun 5 '13 at 23:49

1 Answer 1

up vote 1 down vote accepted

Here is good copy guide for inserting big amount of data.
Here is good answer for similar question

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.