Skip site navigation (1) Skip section navigation (2)

Re: psql COPY with JDBC

From: "Guy Rouillier" <guyr(at)masergy(dot)com>
To: <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: psql COPY with JDBC
Date: 2006-04-04 00:13:26
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc
Christopher Condit wrote:
> Yes, that's true, but isn't it significantly faster to use the bulk
> loader for many records. 

That all depends, are you including the time to customize and maintain
the code?  The INSERT method will work without changing any driver code.
I dumped an Oracle database using ora2pg, which generates INSERT
statements, and I inserted 8 million rows fairly fast on mediocre
hardware (dual 1 GHz Pentium III).

> -Chris
> -----Original Message-----
> From: pgsql-jdbc-owner(at)postgresql(dot)org
> [mailto:pgsql-jdbc-owner(at)postgresql(dot)org] On Behalf Of Guy Rouillier 
> Sent: Monday, April 03, 2006 4:37 PM
> To: pgsql-jdbc(at)postgresql(dot)org
> Subject: Re: [JDBC] psql COPY with JDBC
> Christopher Condit wrote:
>> Hi All-
>> I've been trying over at the general postgres list with no luck, so I
>> thought I'd try here.  I need to bulk load results from a Java
>> application on one machine to a postgres db on a remote server.  I
>> know I can use psql interactively to accomplish this, but I'd like to
>> be able to do it programmatically: 1)       I noticed that there was
>> a COPY patch floating around a couple of years ago - does this still
>> exist.  If so, has it been updated for the latest JDBC driver? 2)
>> Is there a better way to accomplish this than the above patch - with
>> or without JDBC?
> Well, since you are using a Java application, you are not limited to
> COPY, correct?  You can generate whatever output format you want.  In
> that case, you can generate INSERT statements, right?  

Guy Rouillier

pgsql-jdbc by date

Next:From: Pavan KumarDate: 2006-04-04 09:04:29
Subject: thread hang on execute call
Previous:From: Christopher ConditDate: 2006-04-03 23:39:24
Subject: Re: psql COPY with JDBC

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group