Re: bulk inserts

Поиск
Список
Период
Сортировка
От Dave Huber
Тема Re: bulk inserts
Дата
Msg-id 7CDADB576E07AC4FA71E1B12566C9126540E0A0C2E@lti-mb-1.LTI.com
обсуждение исходный текст
Ответ на Re: bulk inserts  (Sam Mason <sam@samason.me.uk>)
Ответы Re: bulk inserts  (Sam Mason <sam@samason.me.uk>)
Список pgsql-general
Thanks, Sam and Martijn. I am attempting to use the COPY command now. I had misunderstood what was meant by STDIN and
assumedI could only use a file for my application and wasn't aware of PQputCopyData(). One assumption I am operating
underright now is that the format of the binary file is the same as the buffer in PQputCopyData, including the header.
IfI am wrong, could someone please let me know? Thanks, 

Dave

-----Original Message-----
From: pgsql-general-owner@postgresql.org [mailto:pgsql-general-owner@postgresql.org] On Behalf Of Sam Mason
Sent: Monday, September 28, 2009 3:53 PM
To: pgsql-general@postgresql.org
Subject: Re: [GENERAL] bulk inserts

On Mon, Sep 28, 2009 at 10:38:05AM -0500, Dave Huber wrote:
> Using COPY is out of the question as the file is not formatted for
> that and since other operations need to occur, the file needs to be
> read sequentially anyway.

Just to expand on what Martin said; if you can generate a set of EXECUTE
commands, you can certainly generate a COPY command to insert the same
data.  The advantage is a large drop in parse time for inserting larger
numbers of rows.  As you're saying you want to insert 500 rows, I'd
suggest at least trying to get COPY working.

--
  Sam  http://samason.me.uk/

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


This electronic mail message is intended exclusively for the individual(s) or entity to which it is addressed. This
message,together with any attachment, is confidential and may contain privileged information. Any unauthorized review,
use,printing, retaining, copying, disclosure or distribution is strictly prohibited. If you have received this message
inerror, please immediately advise the sender by reply email message to the sender and delete all copies of this
message.
THIS E-MAIL IS NOT AN OFFER OR ACCEPTANCE: Notwithstanding the Uniform Electronic Transactions Act or any other law of
similarimport, absent an express statement to the contrary contained in this e-mail, neither this e-mail nor any
attachmentsare an offer or acceptance to enter into a contract, and are not intended to bind the sender, LeTourneau
Technologies,Inc., or any of its subsidiaries, affiliates, or any other person or entity. 
WARNING: Although the company has taken reasonable precautions to ensure no viruses are present in this email, the
companycannot accept responsibility for any loss or damage arising from the use of this email or attachments. 


В списке pgsql-general по дате отправления:

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: pgday.eu 2009: Schedule available and registration open
Следующее
От: Sam Mason
Дата:
Сообщение: Re: bulk inserts