Re: CopyManager.copyOut stuck in socket read

From: Sehrope Sarkuni <sehrope(at)jackdb(dot)com>
To: Karthik Shivashankar <kshivashank(at)sandvine(dot)com>
Cc: "pgsql-jdbc(at)postgresql(dot)org" <pgsql-jdbc(at)postgresql(dot)org>, Doug Fickling <dfickling(at)sandvine(dot)com>, Padam Sonar <psonar(at)sandvine(dot)com>, Raghavendra Chikmagalur Eswarappa <reswarappa(at)sandvine(dot)com>
Subject: Re: CopyManager.copyOut stuck in socket read
Date: 2020-05-20 12:55:38
Message-ID: CAH7T-aoTjLs9C3=4x+cEtHOK+9CB_8A-oJdinQmczc7z2bMnuQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

<https://www.jackdb.com/>
On Wed, May 20, 2020 at 3:34 AM Karthik Shivashankar <
kshivashank(at)sandvine(dot)com> wrote:

> We are using a java application that does something like “COPY (select xyz
> from abc ) TO filename.csv.gz” using JDBC to postgres 9.3.11 server.
>

A COPY command which outputs to a server file must be executed as a regular
query, not as a COPY statement. Use a regular JDBC java.sql.Statement, not
the PGJDBC driver specific CopyManager classes.

The PGJDBC specific CopyManager classes are for COPY operations that read
"... FROM STDIN" or write "... TO STDOUT".

I'm not sure exactly what's causing it to hang but I bet it's waiting for
COPY related messages from the server that are never arriving because the
executed command is not returning a COPY stream.

Regards,
-- Sehrope Sarkuni
Founder & CEO | JackDB, Inc. | https://www.jackdb.com/

>

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Karthik Shivashankar 2020-05-20 14:14:21 RE: CopyManager.copyOut stuck in socket read
Previous Message Karthik Shivashankar 2020-05-20 06:59:47 CopyManager.copyOut stuck in socket read