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 1nKVag-0003lb-8Q for pgsql-hackers@arkaria.postgresql.org; Thu, 17 Feb 2022 01:28:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nKVae-0004Ev-QT for pgsql-hackers@arkaria.postgresql.org; Thu, 17 Feb 2022 01:28:12 +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 1nKVae-0004El-HQ for pgsql-hackers@lists.postgresql.org; Thu, 17 Feb 2022 01:28:12 +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 1nKVac-00057K-9r for pgsql-hackers@postgresql.org; Thu, 17 Feb 2022 01:28:12 +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 21H1S2g93518939; Wed, 16 Feb 2022 20:28:02 -0500 From: Tom Lane To: Andres Freund cc: Fabien COELHO , Alvaro Herrera , Peter Eisentraut , pgsql-hackers Subject: Re: libpq async duplicate error results In-reply-to: <20220217011109.edkms5f2iqr3ofmv@alap3.anarazel.de> References: <22d52a5b-31ce-d951-1f5f-3403d793cec3@enterprisedb.com> <269608.1643904273@sss.pgh.pa.us> <979911.1644253651@sss.pgh.pa.us> <3510062.1645055497@sss.pgh.pa.us> <20220217011109.edkms5f2iqr3ofmv@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Wed, 16 Feb 2022 17:11:09 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3518937.1645061282.1@sss.pgh.pa.us> Date: Wed, 16 Feb 2022 20:28:02 -0500 Message-ID: <3518938.1645061282@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Andres Freund writes: > On 2022-02-16 18:51:37 -0500, Tom Lane wrote: >> + /* Also, do nothing if the argument is OOM_result */ >> + if (res == unconstify(PGresult *, &OOM_result)) >> + return; > Wouldn't it make more sense to make res const, rather than unconstifying > &OOM_result? Uh ... then we'd have to cast away the const to do free(). regards, tom lane