Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i0ikl-0002Rj-Hx for pgsql-general@arkaria.postgresql.org; Thu, 22 Aug 2019 08:47:31 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1i0iki-0001L6-KX for pgsql-general@arkaria.postgresql.org; Thu, 22 Aug 2019 08:47:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1i0iki-0001He-8I for pgsql-general@lists.postgresql.org; Thu, 22 Aug 2019 08:47:28 +0000 Received: from serveurmail01.codata.be ([82.146.123.190]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1i0ikf-00057d-Om for pgsql-general@postgresql.org; Thu, 22 Aug 2019 08:47:26 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by serveurmail01.codata.be (Postfix) with ESMTP id 5B279900CC for ; Thu, 22 Aug 2019 10:47:24 +0200 (CEST) X-Virus-Scanned: amavisd-new at serveurmail01.codata.be Received: from serveurmail01.codata.be ([127.0.0.1]) by localhost (serveurmail01.codata.be [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id z2XKk-PjteAb for ; Thu, 22 Aug 2019 10:47:23 +0200 (CEST) Received: from [10.0.0.100] (38-179-112-217.fix.adsl.belcenter.be [217.112.179.38]) by serveurmail01.codata.be (Postfix) with ESMTPSA id 4F26E900C0 for ; Thu, 22 Aug 2019 10:47:23 +0200 (CEST) To: pgsql-general@postgresql.org Reply-To: arnaud.listes@codata.eu From: "Arnaud L." Subject: psql \copy hanging Message-ID: Date: Thu, 22 Aug 2019 10:47:22 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk 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 ? 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