From: Arnaud L. <arnaud.listes@codata.eu>
To: Luca Ferrari <fluca1978@gmail.com>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: psql \copy hanging
Date: Tue, 27 Aug 2019 12:34:31 +0200
Message-ID: <b73603c5-de86-97c3-03fa-15e0499452e4@codata.eu> (raw)
In-Reply-To: <CAKoxK+4TWweuGqjpRtcQc3r==3N9mTb=qW0+qPi8YAAev6hhHw@mail.gmail.com>
References: <d5df5507-7491-5877-5412-c9325d0ec49c@codata.eu>
<6947a518-82dd-fc26-57b3-6da5e8b89445@codata.eu>
<CAKoxK+5qWTmmEeGFU8nG3JxGuUKSMUnFtUFkEcjCCYLCWSqaew@mail.gmail.com>
<4f450814-5697-06b1-651b-540cac0a10b0@codata.eu>
<CAKoxK+4TWweuGqjpRtcQc3r==3N9mTb=qW0+qPi8YAAev6hhHw@mail.gmail.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: arnaud.listes@codata.eu, fluca1978@gmail.com
Subject: Re: psql \copy hanging
In-Reply-To: <b73603c5-de86-97c3-03fa-15e0499452e4@codata.eu>
References: <d5df5507-7491-5877-5412-c9325d0ec49c@codata.eu> <6947a518-82dd-fc26-57b3-6da5e8b89445@codata.eu> <CAKoxK+5qWTmmEeGFU8nG3JxGuUKSMUnFtUFkEcjCCYLCWSqaew@mail.gmail.com> <4f450814-5697-06b1-651b-540cac0a10b0@codata.eu> <CAKoxK+4TWweuGqjpRtcQc3r==3N9mTb=qW0+qPi8YAAev6hhHw@mail.gmail.com> <b73603c5-de86-97c3-03fa-15e0499452e4@codata.eu>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox