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 1jEDQJ-0001zR-GU for pgsql-bugs@arkaria.postgresql.org; Tue, 17 Mar 2020 14:42:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jEDQI-0000pk-Ae for pgsql-bugs@arkaria.postgresql.org; Tue, 17 Mar 2020 14:42:26 +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 1jEDQH-0000pd-V1 for pgsql-bugs@lists.postgresql.org; Tue, 17 Mar 2020 14:42:26 +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 1jEDQF-0003j8-Ly for pgsql-bugs@lists.postgresql.org; Tue, 17 Mar 2020 14:42:24 +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 02HEg8WG001033; Tue, 17 Mar 2020 10:42:08 -0400 From: Tom Lane To: Robert Haas cc: Amit Langote , digoal@126.com, PostgreSQL mailing lists Subject: Re: BUG #16302: too many range table entries - when count partition table(65538 childs) In-reply-to: References: <16302-e45634e2c0e34e97@postgresql.org> <32763.1584198185@sss.pgh.pa.us> <28094.1584326310@sss.pgh.pa.us> <31331.1584452939@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Tue, 17 Mar 2020 10:33:11 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1031.1584456128.1@sss.pgh.pa.us> Date: Tue, 17 Mar 2020 10:42:08 -0400 Message-ID: <1032.1584456128@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Robert Haas writes: > On Tue, Mar 17, 2020 at 9:49 AM Tom Lane wrote: >> We'd have to widen AttrNumber to int32 and find all the places that >> assume it's only 16 bits. (Good luck with testing your way to having >> any confidence in having found them all, so I'm not sure exactly how >> to acquire such confidence.) Maybe someday that will be a profitable >> use of developer effort, but I have to say that I think that day is >> a long way off. > That sounds like a lot of work, but I think AttrNumber is used to > store varattno, and I think varno is typically stored using either > Index or int, both of which are 32 bits. Am I confused? Argh, -ENOCAFFEINE. You're right, AttrNumber is not the relevant type here. There's still an issue of whether anyplace has tried to store a varno in less-than-int, but it seems less likely than I was thinking earlier. > (It doesn't seem like we're all that careful about whether we're using > int, which is signed, or Index, which is unsigned, and we might want > to go around and tighten that up. Yeah, I'd be leery of trying to use that last bit. The cost-benefit ratio on that is *definitely* not attractive. regards, tom lane