From: Adrian Klaver <adrian.klaver@aklaver.com>
To: arnaud.listes@codata.eu
To: pgsql-general@postgresql.org
Subject: Re: psql \copy hanging
Date: Thu, 22 Aug 2019 07:00:14 -0700
Message-ID: <f9cb2bae-9f54-df3d-900d-82371d6fb62c@aklaver.com> (raw)
In-Reply-To: <d5df5507-7491-5877-5412-c9325d0ec49c@codata.eu>
References: <d5df5507-7491-5877-5412-c9325d0ec49c@codata.eu>
On 8/22/19 1:47 AM, Arnaud L. wrote:
> Hi list
>
> On Windows, I have an unattended script that exports data overnight by
> issuing psql commands like :
> psql -f mycommands.sql
> whith mycommands.sql containing a bunch of \copy lines like :
> \copy (SELECT * FROM someview) TO
> '\\windowsserver\windowsshare\somefile.csv'
>
> When I run this script by hand, everything is fine but when it runs
> overnight it hangs and allways on the same line.
> There is no lock in the database, and the connection is marked as active
> in the backend and running the statement "COPY (SELECT * FROM myview) TO
> STDOUT".
> So where can things be hanging ?
The first thing I think of when seeing this sort of behavior on Windows
is anti-virus software. Doing you have any running on the machine?
You say it always hangs on the same line. Is that line doing something
different from the others? Say writing to a different location.
> My first guess (appart from db lock) was that the target file was locked
> by the filesystem. But wouldn't psql know about it and fail with an error ?
>
> Thanks for your help !
>
> --
> Arnaud
>
>
>
--
Adrian Klaver
adrian.klaver@aklaver.com
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: adrian.klaver@aklaver.com, arnaud.listes@codata.eu
Subject: Re: psql \copy hanging
In-Reply-To: <f9cb2bae-9f54-df3d-900d-82371d6fb62c@aklaver.com>
References: <d5df5507-7491-5877-5412-c9325d0ec49c@codata.eu> <f9cb2bae-9f54-df3d-900d-82371d6fb62c@aklaver.com>
* 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