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 1iHnPp-0006y2-Bt for pgsql-general@arkaria.postgresql.org; Tue, 08 Oct 2019 11:12:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iHnPn-0004BX-Po for pgsql-general@arkaria.postgresql.org; Tue, 08 Oct 2019 11:12:27 +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 1iHnPn-0004BO-FI for pgsql-general@lists.postgresql.org; Tue, 08 Oct 2019 11:12:27 +0000 Received: from serveurmail01.codata.be ([82.146.123.190]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iHnPl-0003DL-C8 for pgsql-general@postgresql.org; Tue, 08 Oct 2019 11:12:27 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by serveurmail01.codata.be (Postfix) with ESMTP id 09B52900C9; Tue, 8 Oct 2019 13:12: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 dog766GBKqcn; Tue, 8 Oct 2019 13:12: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 2CFAA900C0; Tue, 8 Oct 2019 13:12:23 +0200 (CEST) Reply-To: arnaud.listes@codata.eu Subject: Re: psql \copy hanging To: Daniel Verite Cc: Adrian Klaver , pgsql-general References: From: "Arnaud L." Message-ID: Date: Tue, 8 Oct 2019 13:12:21 +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: Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Le 08/10/2019 à 12:55, Daniel Verite a écrit : > Arnaud L. wrote: > >> 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. > > Testing this with 11.5, it works for me. > Make sure you're running the latest minor release (on the client > side in this case), because a related fix was issued last February. > For the 11 branch it was in version 11.2. I'm on 11.5-1 on the client side, but I had added an output redirection for this batch file to try to understand what was happening during the night runs, and that might be the reason why \g fails (i.e. some interference between the console redirections). I'll give it another try without these redirections. Regards -- Arnaud