Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mq5Mb-0003PK-O7 for pgsql-bugs@arkaria.postgresql.org; Thu, 25 Nov 2021 03:23:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mq5Ma-0001nI-I0 for pgsql-bugs@arkaria.postgresql.org; Thu, 25 Nov 2021 03:23:56 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mq5MZ-0001n6-2w for pgsql-bugs@lists.postgresql.org; Thu, 25 Nov 2021 03:23:56 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mq5MV-0006b4-6c for pgsql-bugs@lists.postgresql.org; Thu, 25 Nov 2021 03:23:54 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 399233201C12; Wed, 24 Nov 2021 22:23:47 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 24 Nov 2021 22:23:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=IUkNp6FZrQFCEjmOBEPIbZ9ybaH o1IncD9ex3OSei+g=; b=rHSNT4LH+e0Q+8SnTGpV37Nu+Fm98onvVhRha3KdHjh cCyWb4Vwg9I2huAeT7yx8cgMS5So3p3rRB3wSDPOma0sVlQnkuuBCvBXPU/ofz6r GNZJNZvoGJePX5bONZlItDqJ6M7rE10Xh0CjjuiyRwlqWd3NCIliDz/sVo1Mlse4 941GwKoRnO0Jw814uUg2w5NkqIYjRqgUF04nDtMR9zizPCMFdl7NDyilHq2/yuFu zfijuVjxex7qU+HPkPDsPQhq76Fw6+dJtEpl8O3v0Gljd7Fbv3pcF5Co8EZte13L bg79S1/0+2WksOfeyP7coUfgt4CnEipZjAUXzjQWv7A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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=IUkNp6 FZrQFCEjmOBEPIbZ9ybaHo1IncD9ex3OSei+g=; b=iSifBcFBy9cyI6ej1Axj8x ggCeQOQMWJGUt57H6flsmaqiNgqH+JLU5IE2RljND09xCuY9LETQSLukYaIx+hVr JQXjiHZIUkMqNtkpXBEq9VCHHay5Jlg4o05ic19uJvJZnjYn3G+m9zp35yEGmhKt ETLdVNAogvL3EAuuupuqGdBhwREn8ipbyMJoPQIKabNMYTFzozpN+sv9xAoZNtsq gEfrRTXIOY+viK6xokkJnY9TE9zqC5o0f0DH0GkWR9O6LzIGMOkpfReb++1tTBHO 20xGfW9MpCAHHGf7kesxFZsA1DDfhWMUMFJrkz37a+n2zBUn6BfX2NPKM58PC6xw == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrgeelgdehhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdejtddmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredttddv necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepvdegudeuhfdtueeltedtveejheeh ieevueeigeelteegleejleeiueeiheegvefhnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihii X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 24 Nov 2021 22:23:44 -0500 (EST) Date: Thu, 25 Nov 2021 12:23:41 +0900 From: Michael Paquier To: Dmitry Koval Cc: Juan =?iso-8859-1?Q?Jos=E9_Santamar=EDa?= Flecha , PostgreSQL mailing lists Subject: Re: BUG #17288: PSQL bug with COPY command (Windows) Message-ID: References: <4c22d38f-efa9-4d83-c551-707f1770e585@postgrespro.ru> <9caa0612-19e5-f860-4b97-908a1c721233@postgrespro.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Id3dypAdglwKoezE" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Id3dypAdglwKoezE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Nov 24, 2021 at 10:44:09AM +0300, Dmitry Koval wrote: > Unfortunately, you are. > All my COPY-tests work well with files. > I see a problem in the terminal only ... While checking all the callers of fstat() in the core code, I have discovered that this broke a second case when stdout is not redirected: pg_recvlogical -f -. In this case, the code would just bump on EINVAL repeatedly instead of crashing, but equally broken it was. There is a TAP test for this case in src/bin/pg_basebackup/, but it would not trigger the problem per the redirection already done there. Anyway, I have run more tests, tweaked slightly the comment, and applied it down to 14. Thanks to both of you! -- Michael --Id3dypAdglwKoezE Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmGfAb0ACgkQnvQgOdby QH333Q/8DLFMQumhHsXqPz/+q4Bq59vFa4ldIs/NmjNCUCFWwgxsfFagF6/K9/PQ 13FIMbJ09vAdQHFIc/5iftqBBhA8hQs0knMI3IMrUt6NdtQ1UKbt0EMKaU5RJkLE jLNPwb6BDz/gIsH8RCTTs0+BYzSseK5l7mD6J07fjZZxjKuKeyDj7uZUO2gYgo3D swJHIuqRsIzkC+/9hpYFRiHu8AaT/wHKjyJ131qW7HNu9O5UzaVvPjNCV4AkXspR uWjvhsu9bpy5RozCt+QWqiPSs2NIhCv3SZAa59HfFBzp1UZHWpt90Z6CHk5icqrR nfhnEYT+SrfzCV1YnUUddrnpxJZTUNRcyJYjZJsU0h8yi4E50WUMy6ahrdB1RiuX RlkVVdeywVicS1jL6LRnaNau/V/VqYdRMHCJuKjyZteKZVU3eVcphkOs+TqVUXxB 3mGO6wu4O2OogdJHONZ4P6blRn1KAoqDu567WMRPxWf+NDTj3GOdy2yK58lyX2HU 7Pegq7iBbOXHWeS9IF5Y1CeZvPU2wWl13Eia2TqfAYnQk8/ZDAtFMQ+c14tWwXkL LzSwvkHAN+KH6/GmHUnjgZcuO/Qnx0WaoUC9QPvTyXG6UnL6GI1+Dyc4FyDlxmac tPJSa0OZ+m1RmSC5gTkONMd+6OZu01wOB/OjkeLDuInnyLNgOhg= =VAq1 -----END PGP SIGNATURE----- --Id3dypAdglwKoezE--