Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bpjVt-0003KJ-6z for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Sep 2016 22:09:09 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bpjVs-0000iZ-G6 for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Sep 2016 22:09:08 +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_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bpjVq-0000ho-2j for pgsql-hackers@postgresql.org; Thu, 29 Sep 2016 22:09:06 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bpjVj-0000fv-66 for pgsql-hackers@postgresql.org; Thu, 29 Sep 2016 22:09:05 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u8TM8sT5014720; Thu, 29 Sep 2016 18:08:54 -0400 From: Tom Lane To: Alvaro Herrera cc: Thomas Kellerer , pgsql-hackers@postgresql.org Subject: Re: [GENERAL] pg_upgrade from 9.5 to 9.6 fails with "invalid argument" In-reply-to: <20160929214015.GA446237@alvherre.pgsql> References: <20160929214015.GA446237@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Thu, 29 Sep 2016 18:40:15 -0300" Date: Thu, 29 Sep 2016 18:08:53 -0400 Message-ID: <14719.1475186933@sss.pgh.pa.us> X-Pg-Spam-Score: -4.9 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Alvaro Herrera writes: > Tom Lane wrote: >> I wouldn't even put a lot of faith in the errno being meaningful, >> considering that it does close() calls before capturing the errno. > So we do close() in a bunch of places while closing shop, which calls > _close() on Windows; this function sets errno. But only on failure, no? The close()s usually shouldn't fail, and therefore shouldn't change errno, it's just that you can't trust that 100%. I think likely what's happening is that we're seeing a leftover value from some previous syscall that set GetLastError's result (and, presumably, wasn't fatal so far as pg_upgrade was concerned). regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers