Re: psql \copy hanging - Mailing list pgsql-general

From Arnaud L.
Subject Re: psql \copy hanging
Date
Msg-id b73603c5-de86-97c3-03fa-15e0499452e4@codata.eu
Whole thread Raw
In response to Re: psql \copy hanging  (Luca Ferrari <fluca1978@gmail.com>)
Responses Re: psql \copy hanging
List pgsql-general
Le 27/08/2019 à 10:57, Luca Ferrari a écrit :
> On Tue, Aug 27, 2019 at 10:48 AM Arnaud L. <arnaud.listes@codata.eu> wrote:
>> I can run the script just fine during working hours.
> 
> I meant thru your scheduler (cron or something).

Yes, it runs fine too. There is indeed something happening on the server 
at this specific time but I don't know what.


>> It hangs against the same line in the sql script, all lines being "\copy
>> (select ....) to 'file on unc share'".
> 
> This is a new detail to me: what if you output to a local file and
> move it after on the share?

I could do this but it would make the script a lot more complicated.
There are a lot of views that I \copy directly to this share, and this 
is the only one that poses any problem.


> I still don't get: is the line content the longest or the highest
> numbered in the output?

Sorry, I don't undertand either. Your question was "Does it hangs 
against the same line content or the same line number?".
I run an sql script that contains a bunch of \copy commands. It is 
always the same \copy that is hanging.


>> Also when the script is hung, output has not started (file size is 0).
> 
> This makes me think there is some problem with the share, not the
> script. Again: test against a local file that you move (rsync?) to the
> share after.

Everything is windows based, so rsync is not really an option. There are 
alternatives of course.
I could write the file locally, but for robustness I'm trying not to 
rely on the local FS so that this script could be run from any machine 
on the network without modifications.

Cheers
--
Arnaud



pgsql-general by date:

Previous
From: "Holtgrewe, Manuel"
Date:
Subject: Pointers towards identifying bulk import bottleneck (walwritertuning?)
Next
From: Giuseppe Sacco
Date:
Subject: Re: Question about password character in ECPG's connection string