Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1jHTC6-00058b-2r for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Mar 2020 14:09:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jHTC4-0003VW-Rv for pgsql-hackers@arkaria.postgresql.org; Thu, 26 Mar 2020 14:09:12 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1jHTC4-0003VP-Fo for pgsql-hackers@lists.postgresql.org; Thu, 26 Mar 2020 14:09:12 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jHTC2-00031h-6T for pgsql-hackers@lists.postgresql.org; Thu, 26 Mar 2020 14:09:11 +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 02QE8cYY011358; Thu, 26 Mar 2020 10:08:38 -0400 From: Tom Lane To: Ashutosh Bapat cc: "movead.li@highgo.ca" , pgsql-hackers Subject: Re: A bug when use get_bit() function for a long bytea string In-reply-to: References: <20200312115135445367128@highgo.ca> <20200313111842791351178@highgo.ca> <2020031810480643107833@highgo.ca> Comments: In-reply-to Ashutosh Bapat message dated "Thu, 26 Mar 2020 19:01:59 +0530" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <11356.1585231718.1@sss.pgh.pa.us> Date: Thu, 26 Mar 2020 10:08:38 -0400 Message-ID: <11357.1585231718@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Ashutosh Bapat writes: > On Wed, 18 Mar 2020 at 08:18, movead.li@highgo.ca > wrote: >> if we change return type of all those functions to int64, we won't need >> this cast. >> I change the 'encode' function, it needs an int64 return type, but keep >> other >> functions in 'pg_encoding', because I think it of no necessary reason. > Ok, let's leave it for a committer to decide. If I'm grasping the purpose of these correctly, wouldn't Size or size_t be a more appropriate type? And I definitely agree with changing all of these APIs at once, if they're all dealing with the same kind of value. regards, tom lane