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 1mLSbu-0005gU-MD for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Sep 2021 15:57:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mLSbt-00015S-GP for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Sep 2021 15:57:09 +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 1mLSbt-00015K-8j for pgsql-hackers@lists.postgresql.org; Wed, 01 Sep 2021 15:57:09 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mLSbm-00032P-QH for pgsql-hackers@lists.postgresql.org; Wed, 01 Sep 2021 15:57:08 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 181Fuv802077916; Wed, 1 Sep 2021 11:56:57 -0400 From: Tom Lane To: Mario Emmenlauer cc: pgsql-hackers@lists.postgresql.org Subject: Re: dup(0) fails on Ubuntu 20.04 and macOS 10.15 with 13.0 In-reply-to: References: <48bafc63-c30f-3962-2ded-f2e985d93e86@emmenlauer.de> <3ac84ee7-b4a0-aba5-ddb5-b7c0811fc754@emmenlauer.de> <1c4c2254-1812-2913-8630-18d4b9262a89@emmenlauer.de> <2071112.1630504486@sss.pgh.pa.us> Comments: In-reply-to Mario Emmenlauer message dated "Wed, 01 Sep 2021 17:49:57 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2077914.1630511817.1@sss.pgh.pa.us> Date: Wed, 01 Sep 2021 11:56:57 -0400 Message-ID: <2077915.1630511817@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Mario Emmenlauer writes: > The idea to switch to dup(2) sounds very good to me. Also, while at it, > maybe the error message could be improved? The kids nowadays don't learn > so much about system I/O any more, and if someone does not know `dup()`, > then the error message is not very telling. It took me a while to under- > stand what the code was supposed to do. So it may be helpful to add to > the error message something like "possible the stderr stream is closed, > this is not supported". What do you think? Meh ... it's been like that for ~20 years and you're the first one to complain, so I'm not inclined to make our translators spend effort on a HINT message. However, we could reword it to the extent of, say, elog(WARNING, "duplicating stderr failed after %d successes: %m", used); which at least reduces the jargon level to something that Unix users should have heard of. regards, tom lane