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 1iHq57-0005X2-45 for pgsql-general@arkaria.postgresql.org; Tue, 08 Oct 2019 14:03:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iHq55-0003uw-Rx for pgsql-general@arkaria.postgresql.org; Tue, 08 Oct 2019 14:03:15 +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 1iHq54-0003uX-69 for pgsql-general@lists.postgresql.org; Tue, 08 Oct 2019 14:03:15 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iHq4z-0004y1-Md for pgsql-general@postgresql.org; Tue, 08 Oct 2019 14:03:13 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 4CBD921B2F; Tue, 8 Oct 2019 10:03:07 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Tue, 08 Oct 2019 10:03:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=F AZQn5UM3Fk+bwAfPTGxt+IvLel69W+493TRYWEj+Fc=; b=1atvnOhjcU1DnC2X3 sNzrqjLeAkb9TzvohKcl5Cpglcm6F13FZcT4OClr9ru7yvbRjOXClpijQ3wnXpJS xgjLwk7w1iDk+iM2lkj11wAbEx+79rqwCZJi4T/GvGuWlOp02mNq31YknHrpbVGy bOJTODCaHolDaUnt3+1yT31iMfKXBfxBa1Xr2w/6TD5K8nHv6xQ7Jeu5yaEIjqR1 q0xpA2MduVEuvXb1kY3XHfiLXmmIdVg720GXdADzF9IDGaGgWsg9gH4d+RE+r0Ng DCnZj69xr9z7UTSDazS8+rD+dZo24NBcxDRdmq95aSXrWTszmSmacXlNjDbI8cHN eqONg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=FAZQn5UM3Fk+bwAfPTGxt+IvLel69W+493TRYWEj+ Fc=; b=UiH8G9PiUOV1CRRpNUe5CIRYtBjHroZNbMtCdrSYM/0UXFXya0S0394bX nSxpmszgEnXwq+qFOeLzfkUJ/VeUYEe4qKFeHwX9Tf4vlELs1K2H6djUN8FgRWsA 6AseUy6M9dax1Uiz0gU1f1ZYuxVKSDOtJ5Ce8Irp9nXKQQQaTeEbi0Hqf+3U6XTf MAvEykgr1ABE7yvMSTkE9YSfP4klgV+J6KIwtZho5NA7hREG4gmYtnigL1VDvyhZ eGC0exPC1JXF8mH/zO+/OgwsIBLzFQqzmlWkZEM5r5tkcce2/eru8ikwshZkwttv JjPJuDrgW3rqQNfaEUX1znHLeIaOg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrheelgdejgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepuffvfhfhkffffgggjggtgfesthekre dttdefjeenucfhrhhomheptegurhhirghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhl rghvvghrsegrkhhlrghvvghrrdgtohhmqeenucffohhmrghinhepphhoshhtghhrvghsqh hlrdhorhhgnecukfhppeejuddrvdduvddrudehuddrudeiieenucfrrghrrghmpehmrghi lhhfrhhomheprggurhhirghnrdhklhgrvhgvrhesrghklhgrvhgvrhdrtghomhenucevlh hushhtvghrufhiiigvpedt X-ME-Proxy: Received: from [192.168.1.3] (unknown [71.212.151.166]) by mail.messagingengine.com (Postfix) with ESMTPA id D5943D6005A; Tue, 8 Oct 2019 10:03:05 -0400 (EDT) Subject: Re: psql \copy hanging To: arnaud.listes@codata.eu, pgsql-general References: <9e9164df-e7b7-bcd3-538a-7714907f7df4@aklaver.com> <171491de-b8e1-7f0d-0724-4d06a7902cc0@codata.eu> <291938b2-5816-5858-065f-e85387def0eb@aklaver.com> <230d9c65-450f-b97c-7ef0-c8e9a85103f6@codata.eu> <8f921914-178e-b520-7f93-dab80ea02555@aklaver.com> From: Adrian Klaver Message-ID: <5612153a-af11-38da-c34e-8b4bab9cfc8e@aklaver.com> Date: Tue, 8 Oct 2019 07:03:04 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 10/8/19 12:06 AM, Arnaud L. wrote: > Le 07/10/2019 à 16:36, Adrian Klaver a écrit : >> So you are saying that you have not run the problematic line by itself? > > It hung during last night's run. > > I had modified my batch script to run the \copy commands separately, > i.e. it now reads as : > psql -h myserver -a mydb < originalscriptwithoutproblematicline.sql > psql -h myserver -a mydb < problematicline.sql This is going to be hard to troubleshoot if you change your commands. Previously you had: psql -h %MYPGSERVER% -a -f myscript.sql %MYPGDB% Changing more then one thing at a time makes it that much more difficult to isolate the issue. I would create an entirely separate batch file that runs just problematicline.sql. Given that you suspect Postgres it would be helpful to see the query that underlies the view you are copying. You might want to look at autoexplain: https://www.postgresql.org/docs/11/auto-explain.html as a way of getting information at run time. > > It hung at the problematic line, so during the second psql command. > > I'm really at loss... I *believe* that the problem lies either in psql > or in PostgreSQL, but I really don't know what to try now. > > > Regards > -- > Arnaud > -- Adrian Klaver adrian.klaver@aklaver.com