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 1iGHs2-0004D6-K3 for pgsql-general@arkaria.postgresql.org; Fri, 04 Oct 2019 07:19:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iGHs0-0008Gr-48 for pgsql-general@arkaria.postgresql.org; Fri, 04 Oct 2019 07:19:20 +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 1iGHrz-0008GQ-QN for pgsql-general@lists.postgresql.org; Fri, 04 Oct 2019 07:19:19 +0000 Received: from serveurmail01.codata.be ([82.146.123.190]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iGHrx-0003hH-IX for pgsql-general@postgresql.org; Fri, 04 Oct 2019 07:19:19 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by serveurmail01.codata.be (Postfix) with ESMTP id 22BEE900B8; Fri, 4 Oct 2019 09:19:16 +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 jwDkjImt4wjb; Fri, 4 Oct 2019 09:19:15 +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 2D79D900B5; Fri, 4 Oct 2019 09:19:15 +0200 (CEST) Reply-To: arnaud.listes@codata.eu Subject: Re: psql \copy hanging To: Adrian Klaver , pgsql-general References: <9e9164df-e7b7-bcd3-538a-7714907f7df4@aklaver.com> <171491de-b8e1-7f0d-0724-4d06a7902cc0@codata.eu> <291938b2-5816-5858-065f-e85387def0eb@aklaver.com> From: "Arnaud L." Message-ID: <230d9c65-450f-b97c-7ef0-c8e9a85103f6@codata.eu> Date: Fri, 4 Oct 2019 09:19:13 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <291938b2-5816-5858-065f-e85387def0eb@aklaver.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Le 03/10/2019 à 16:32, Adrian Klaver a écrit : > I may have missed it before, but where is the Postgres server located? On the same local area network. Not on the computer running the script (so direct COPY TO is not an option). > Given that this seems to be some sort of resource issue and that the > below contains commands that are not dependent on each other, have you > thought of splitting myscript.sql into two scripts? If nothing else the > n(total line)-problem line in one script and the problem line in > another. That would help nail down whether that line is truly the > problem or if it is an interaction with running the other 50+ lines. OK I can do that. I thought I nailed it down to this line because it started failing when this line was ~5th in the script, and it kept failing on that very same line after I moved it at the very end of the script (that's where it is now). As a side note, COPY (...) TO STDOUT \g 'somefile' does not work in a script file (i.e. it does not work if the command is passed in a file via the -f argument). The command runs fine, no error is raised either by the client or the server, but no file is written. Regards -- Arnaud