Re: Using statement parameters with Copy API? - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: Using statement parameters with Copy API?
Date
Msg-id alpine.BSO.2.03.1309120004460.15738@ejurka.com
Whole thread Raw
In response to Using statement parameters with Copy API?  (Jim Garrison <jim.garrison@nwea.org>)
List pgsql-jdbc

On Wed, 11 Sep 2013, Jim Garrison wrote:

>
> I want to use the copy API to execute a parameterized query, as in
>
> COPY (SELECT * FROM TABLE WHERE KEY=?) TO STDOUT FORMAT BINARY
>
> As far as I can tell it is not currently possible to prepare this statement
> and pass it to the copy API.
>  

This is a limitation of the server.  It doesn't accept parameterized COPY
statements so the JDBC driver doesn't have a way to pass such a statement.
Perhaps the driver could perform the text interpolation itself as it does
in the V2 protocol, but that would also complicate the API if you wanted
to have something similar to PreparedStatement.

Kris Jurka

pgsql-jdbc by date:

Previous
From: Dave Cramer
Date:
Subject: Re: CopyManager API?
Next
From: Jim Garrison
Date:
Subject: Using CopyManager with pooled JCA connection