3

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?

3
  • Use COPY. See the npgsql manual. Commented Jun 4, 2013 at 23:30
  • Thanks. I have already checked that and I was having problems because of the data I need to import Commented Jun 5, 2013 at 15:02
  • 1
    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. Commented Jun 5, 2013 at 23:49

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.