pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Christoph Haller <ch@rodos.fzk.de>
To: alyandon@yahoo.com
Cc: pgsql-interfaces@postgresql.org
Subject: Re: Bulk updates/inserts
Date: Wed, 14 Apr 2004 14:51:31 METDST
Message-ID: <200404141251.OAA21416@rodos> (raw)
In-Reply-To: <20040402164234.67207.qmail@web41601.mail.yahoo.com>

> 
> Is it currently possible to perform bulk
> updates/inserts via host arrays using ecpg?  If so,
> would someone mind showing me an example of the proper
> syntax as I can't seem to come up with something that
> the ecpg preprocessor likes.
> 
> On a side note, if ecpg doesn't support bulk
> inserts/updates are there any plans for adding such
> support?  Is there anyway programmatically to get
> close to the same speed for inserts/updates as say the
> COPY command?
> 
> Regards,
> 
> Shelby Cain
> 
> __________________________________

Doing bulk inserts via host arrays is not possible AFAICT. 
I posted a similar request in February 2003. 
See 
http://archives.postgresql.org/pgsql-interfaces/2003-02/msg00091.php 

BTW, I don't see how a bulk update could be done. 

There is a way to use COPY programmatically via libpq: 

something like ...

PQexec("COPY xxx FROM stdin");
for (...)
{
    sprintf(buf, "%d\t%d\t...\n",
            values[0], values[1], ... values[n]);
    PQputline(conn, buf);
}
PQputline(conn, "\\.\n");
PQendcopy(conn);

Regards, Christoph 




view thread (3+ messages)  latest in thread

Message-ID: <200404141251.OAA21416@rodos>
Permalink:  ../200404141251.OAA21416@rodos/
Also on:    postgresql.org/message-id/200404141251.OAA21416@rodos

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: ch@rodos.fzk.de, alyandon@yahoo.com
  Subject: Re: Bulk updates/inserts
  In-Reply-To: <200404141251.OAA21416@rodos>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox