Re: psql COPY with JDBC - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: psql COPY with JDBC
Date
Msg-id 4611BA97.4060400@opencloud.com
Whole thread Raw
In response to Re: psql COPY with JDBC  (Kevin Murphy <murphy@genome.chop.edu>)
List pgsql-jdbc
Kevin Murphy wrote:

> Also: I haven't seen evidence of a JDBC prepared statement approach for
> 8.2's multiple-row INSERTs (using multiple VALUES arguments).  Does such
> a beast exist, or will it?

I assume you can do this without driver changes by preparing a suitable
statement. Presumably you'd do something like prepare a 20-row-insert
statement, use it until you have less than 20 rows left, then prepare
and use single-row-inserts for the remainder.

> Also: what exactly does the PostgreSQL driver do with INSERTs that are
> batched with addBatch?  I must confess I haven't tried this yet.

It prepares them once and sends a pair of Bind/Execute messages for each
set of parameter values, with a Sync at the end. You can see the details
with loglevel=2

-O

pgsql-jdbc by date:

Previous
From: Kevin Murphy
Date:
Subject: Re: psql COPY with JDBC
Next
From: "ste.buffaishere@tin.it"
Date:
Subject: Prepared statement parameter and timestamp