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 1mnmSx-0007Kk-Nj for pgsql-bugs@arkaria.postgresql.org; Thu, 18 Nov 2021 18:49:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mnmSw-00080R-6d for pgsql-bugs@arkaria.postgresql.org; Thu, 18 Nov 2021 18:48:58 +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 1mnmSv-00080C-Sk for pgsql-bugs@lists.postgresql.org; Thu, 18 Nov 2021 18:48:57 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mnmSt-0006HP-T9 for pgsql-bugs@lists.postgresql.org; Thu, 18 Nov 2021 18:48:57 +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 4652821C2189; Thu, 18 Nov 2021 21:48:54 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1637261334; bh=SJ3tvX79P9EmmC1ChVe31Vj/32YPkFVLej8wP6qVK4U=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=SGiHcFglKHKX3iTNUD6qChg4NOB6K5/6r2bvxmK7f18OJQkhEGiSAY9c8vRhPHRJI 1E6EA0Z4uz1xJzpVP1zq98ewT6WWw00hZ0jrl796OQlXL9H2HNqtxKWXRx6RRTYTnG Cr5qNy2F/ce41Ym5kmLjdepPmsrl6eanTptHVvDI= Message-ID: Date: Thu, 18 Nov 2021 21:48:55 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 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> From: Dmitry Koval In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk >You are right about freopen(), but stderr works just because it's being >parsed as a file, not a stream, by parse_slash_copy(). You are right. I wrote about stderr without inspecting code ( >I would keep the memset(buf, 0, sizeof(*buf)) for the members we >are not setting. Of course. Original code (src/port/win32stat.c) contains line memset(buf, 0, sizeof(*buf)) before call GetFileInformationByHandle(). With best regards, Dmitry Koval.