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 1mo2zT-0005Mj-M0 for pgsql-bugs@arkaria.postgresql.org; Fri, 19 Nov 2021 12:27:40 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mo2zR-0003r1-Ol for pgsql-bugs@arkaria.postgresql.org; Fri, 19 Nov 2021 12:27:37 +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 1mo2zR-0003pQ-DJ for pgsql-bugs@lists.postgresql.org; Fri, 19 Nov 2021 12:27:37 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mo2zP-0006sp-V0 for pgsql-bugs@lists.postgresql.org; Fri, 19 Nov 2021 12:27:36 +0000 Received: from [192.168.28.32] (cyclops.postgrespro.ru [93.174.131.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id 4FE2C21C203C; Fri, 19 Nov 2021 15:27:34 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1637324854; bh=XB4Hi6SxdKVQJDEbxCpopBJtmOwi2IRu1V5topHDyec=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=IJMTWj6M8HAA1VZgU2YW5d79G7lfh8HxZ3yi5nLzrzs6ztL4RRmsM0AxAOtzfwuS5 EagBvGvfJKl5NbOoElJ1/cYAJIxq2EGsnzmNmGPPTSnHBDJ6Ebn9mpcABpGv3S5SN0 Yda1/8/CTp6BGONsxdlgubCkW6pl6D4M/YzD/hiQ= Content-Type: multipart/mixed; boundary="------------0vF4OT0ADRkY8QK8bmfCfWLf" Message-ID: Date: Fri, 19 Nov 2021 15:27:34 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.2 Subject: Re: BUG #17288: PSQL bug with COPY command (Windows) Content-Language: ru To: =?UTF-8?Q?Juan_Jos=c3=a9_Santamar=c3=ada_Flecha?= Cc: Michael Paquier , PostgreSQL mailing lists References: <17288-6b58a91025a8a8a3@postgresql.org> <9e4efe29-0ff9-0808-fe32-d1d50e0be4fa@postgrespro.ru> <4c22d38f-efa9-4d83-c551-707f1770e585@postgrespro.ru> <9caa0612-19e5-f860-4b97-908a1c721233@postgrespro.ru> From: Dmitry Koval In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------0vF4OT0ADRkY8QK8bmfCfWLf Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit >GetFinalPathNameByHandleA() is slower when there is redirection, when >there is no redirection it's similar or faster than >GetFileInformationByHandle(), and that should be the most common case. I tested 2 cases: 1) "stdout" is not redirected. In this case GetFinalPathNameByHandleA() returns error and GetFileInformationByHandle() returns error. Simple test in attachment. --- Result: GetFileInformationByHandle: 7, GetFinalPathNameByHandleA: 16 2) "stdout" redirected (need to uncomment 2 lines in test). Both function works without error. --- Result (see file "1.txt"): GetFileInformationByHandle: 34, GetFinalPathNameByHandleA: 120 The difference is not very big, but it is. With best regards, Dmitry. --------------0vF4OT0ADRkY8QK8bmfCfWLf Content-Type: text/plain; charset=UTF-8; name="test2.c" Content-Disposition: attachment; filename="test2.c" Content-Transfer-Encoding: base64 I2luY2x1ZGUgPHdpbmRvd3MuaD4NCiNpbmNsdWRlIDxzdGRpby5oPg0KI2luY2x1ZGUgPGlv Lmg+DQojaW5jbHVkZSA8dGltZS5oPg0KDQppbnQgbWFpbigpDQp7DQoJaW50IGk7DQoJY2xv Y2tfdCB0MSwgdDIsIHQzOw0KCUhBTkRMRSBoRmlsZTsNCglCWV9IQU5ETEVfRklMRV9JTkZP Uk1BVElPTiBmaURhdGE7DQoJY2hhciBwYXRoW01BWF9QQVRIXTsNCgkvL0ZJTEUqIHN0cmVh bTsNCg0KCS8vZnJlb3Blbl9zKCZzdHJlYW0sICIxLnR4dCIsICJhIiwgc3Rkb3V0KTsNCg0K CWhGaWxlID0gKEhBTkRMRSlfZ2V0X29zZmhhbmRsZShfZmlsZW5vKHN0ZG91dCkpOw0KDQoJ dDEgPSBjbG9jaygpOw0KDQoJZm9yIChpID0gMDsgaSA8IDEwMDAwOyBpKyspDQoJCUdldEZp bGVJbmZvcm1hdGlvbkJ5SGFuZGxlKGhGaWxlLCAmZmlEYXRhKTsNCg0KCXQyID0gY2xvY2so KTsNCg0KCWZvciAoaSA9IDA7IGkgPCAxMDAwMDsgaSsrKQ0KCQlHZXRGaW5hbFBhdGhOYW1l QnlIYW5kbGVBKGhGaWxlLCBwYXRoLCBNQVhfUEFUSCwgVk9MVU1FX05BTUVfTlQpOw0KDQoJ dDMgPSBjbG9jaygpOw0KDQoJcHJpbnRmKCJHZXRGaWxlSW5mb3JtYXRpb25CeUhhbmRsZTog JWQsICINCgkJICAgIkdldEZpbmFsUGF0aE5hbWVCeUhhbmRsZUE6ICVkXG4iLCB0MiAtIHQx LCB0MyAtIHQyKTsNCglyZXR1cm4gMDsNCn0NCg== --------------0vF4OT0ADRkY8QK8bmfCfWLf--