Re: psql \copy hanging

From: "Arnaud L(dot)" <arnaud(dot)listes(at)codata(dot)eu>
To: Luca Ferrari <fluca1978(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: psql \copy hanging
Date: 2019-08-27 10:34:31
Message-ID: b73603c5-de86-97c3-03fa-15e0499452e4@codata.eu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Le 27/08/2019 à 10:57, Luca Ferrari a écrit :
> On Tue, Aug 27, 2019 at 10:48 AM Arnaud L. <arnaud(dot)listes(at)codata(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Giuseppe Sacco 2019-08-27 10:40:36 Re: Question about password character in ECPG's connection string
Previous Message Holtgrewe, Manuel 2019-08-27 10:06:31 Pointers towards identifying bulk import bottleneck (walwriter tuning?)