pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Re: Bulk updates/inserts
3+ messages / 2 participants
[nested] [flat]

* Bulk updates/inserts
@ 2004-04-02 16:42 Shelby Cain <alyandon@yahoo.com>
  1970-01-01 00:00 ` Re: Bulk updates/inserts Christoph Haller <ch@rodos.fzk.de>
  0 siblings, 1 reply; 3+ messages in thread

From: Shelby Cain @ 2004-04-02 16:42 UTC (permalink / raw)
  To: pgsql-interfaces

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

__________________________________
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway 
http://promotions.yahoo.com/design_giveaway/



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Bulk updates/inserts
  2004-04-02 16:42 Bulk updates/inserts Shelby Cain <alyandon@yahoo.com>
@ 1970-01-01 00:00 ` Christoph Haller <ch@rodos.fzk.de>
  2004-04-15 04:23   ` Re: Bulk updates/inserts Shelby Cain <alyandon@yahoo.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Christoph Haller @ 1970-01-01 00:00 UTC (permalink / raw)
  To: alyandon@yahoo.com; +Cc: pgsql-interfaces

> 
> 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 




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Bulk updates/inserts
  2004-04-02 16:42 Bulk updates/inserts Shelby Cain <alyandon@yahoo.com>
  1970-01-01 00:00 ` Re: Bulk updates/inserts Christoph Haller <ch@rodos.fzk.de>
@ 2004-04-15 04:23   ` Shelby Cain <alyandon@yahoo.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Shelby Cain @ 2004-04-15 04:23 UTC (permalink / raw)
  To: Christoph Haller <ch@rodos.fzk.de>; +Cc: pgsql-interfaces

--- Christoph Haller <ch@rodos.fzk.de> wrote:
> 
> There is a way to use COPY programmatically via
> libpq: 
> 
> 
> 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 
> 

Excellent.  That'll help reduce my load times.  Thanks
for the help.

Regards,

Shelby Cain


	
		
__________________________________
Do you Yahoo!?
Yahoo! Tax Center - File online by April 15th
http://taxes.yahoo.com/filing.html



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2004-04-15 04:23 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-04-02 16:42 Bulk updates/inserts Shelby Cain <alyandon@yahoo.com>
1970-01-01 00:00 ` Christoph Haller <ch@rodos.fzk.de>
2004-04-15 04:23   ` Shelby Cain <alyandon@yahoo.com>

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