RE: CopyManager.copyOut stuck in socket read

From: Karthik Shivashankar <kshivashank(at)sandvine(dot)com>
To: Sehrope Sarkuni <sehrope(at)jackdb(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 14:14:21
Message-ID: 9fc11af3aa9c4906b2a11ffd486d43ba@sandvine.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Thanks Sehrope. I will check further and get back to you.

From: Sehrope Sarkuni <sehrope(at)jackdb(dot)com>
Sent: Wednesday, May 20, 2020 6:26 PM
To: Karthik Shivashankar <kshivashank(at)sandvine(dot)com>
Cc: 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

[EXTERNAL]
On Wed, May 20, 2020 at 3:34 AM Karthik Shivashankar <kshivashank(at)sandvine(dot)com<mailto: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/

Disclaimer:
This communication (including any attachments) is intended for the use of the intended recipient(s) only and may contain information that is considered confidential, proprietary, sensitive and/or otherwise legally protected. Any unauthorized use or dissemination of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the sender by return e-mail message and delete all copies of the original communication. Thank you for your cooperation.

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2020-05-27 15:15:38 [pgjdbc/pgjdbc] 7ef93f: refactor: Clean up whitespace in existing PgSQLXML...
Previous Message Sehrope Sarkuni 2020-05-20 12:55:38 Re: CopyManager.copyOut stuck in socket read