Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w1uRj-000i5p-1y for pgsql-bugs@arkaria.postgresql.org; Sun, 15 Mar 2026 23:00:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w1uRi-0069y7-26 for pgsql-bugs@arkaria.postgresql.org; Sun, 15 Mar 2026 23:00:31 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w1uRi-0069xq-1K for pgsql-bugs@lists.postgresql.org; Sun, 15 Mar 2026 23:00:31 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w1uRh-00000000J47-0igW for pgsql-bugs@lists.postgresql.org; Sun, 15 Mar 2026 23:00:30 +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 62FN0Sng2247549; Sun, 15 Mar 2026 19:00:28 -0400 From: Tom Lane To: fairyfar@msn.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #19429: An issue regarding the processing of Oid as an int type in ecpg In-reply-to: <19429-aead3b1874be1a99@postgresql.org> References: <19429-aead3b1874be1a99@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Thu, 12 Mar 2026 06:31:58 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2247547.1773615628.1@sss.pgh.pa.us> Date: Sun, 15 Mar 2026 19:00:28 -0400 Message-ID: <2247548.1773615628@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: > Part of the code caches and calculates the Oid as an int type in ecpg. > We know that Oid is unsigned int. When the Oid value is greater than or > equal to 2^31, it exceeds the value range of the int type. There are > potential problems in processing Oid with the int type. For example, when > formatting Oid with "%d", negative values may occur. > Through analysis and testing, it is found that the ecpg part of the code has > not caused any problems so far, but it is running in an obscure way. Yeah, it does work as-is, but it's relying on undocumented details about what the server will do with something like "oid=-1". I reviewed your patch and pushed it. For future reference, it's not great to send patches via our bug report form; whitespace gets mangled and it's quite painful to reconstruct. Better to just send email to pgsql-hackers with the patch in an attachment. regards, tom lane