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 1lxs6X-0008PF-UR for pgsql-bugs@arkaria.postgresql.org; Mon, 28 Jun 2021 14:19:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lxs6W-0003o8-Qg for pgsql-bugs@arkaria.postgresql.org; Mon, 28 Jun 2021 14:19:16 +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 1lxs6W-0003o0-K5 for pgsql-bugs@lists.postgresql.org; Mon, 28 Jun 2021 14:19:16 +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 1lxs6U-0005Ct-KO for pgsql-bugs@lists.postgresql.org; Mon, 28 Jun 2021 14:19:16 +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 15SEJBZJ153443; Mon, 28 Jun 2021 10:19:11 -0400 From: Tom Lane To: barlone@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17074: PQsocket() truncate hande on win64 In-reply-to: <17074-b064bbbb12dc6cf6@postgresql.org> References: <17074-b064bbbb12dc6cf6@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Mon, 28 Jun 2021 12:23:07 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <153441.1624889951.1@sss.pgh.pa.us> Content-Transfer-Encoding: 8bit Date: Mon, 28 Jun 2021 10:19:11 -0400 Message-ID: <153442.1624889951@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > Function PQsocket from libpq returns int. But on win64, int type has 32 > bits, and socket handle has 64 bits. > PQsocket must return а different type, may be ptrdiff_t. We can't just redefine the result type of PQsocket without causing API/ABI breakage everywhere. Perhaps it would be worth inventing a Windows-only function that returns a connection's socket handle. There hasn't been much demand for that though. regards, tom lane