Re: psql COPY with JDBC

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Kevin Murphy <murphy(at)genome(dot)chop(dot)edu>
Cc: pgsql-jdbc(at)postgresql(dot)org, nwakefield(at)kineticnetworks(dot)com
Subject: Re: psql COPY with JDBC
Date: 2007-04-03 02:23:19
Message-ID: 4611BA97.4060400@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message ste.buffaishere@tin.it 2007-04-03 09:28:29 Prepared statement parameter and timestamp
Previous Message Kevin Murphy 2007-04-02 13:57:19 Re: psql COPY with JDBC