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.89) (envelope-from ) id 1gW4Qc-000840-Iy for pgsql-hackers@arkaria.postgresql.org; Sun, 09 Dec 2018 19:07:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gW4Qa-0005oF-0Q for pgsql-hackers@arkaria.postgresql.org; Sun, 09 Dec 2018 19:07:44 +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 1gW4QZ-0005o8-DF for pgsql-hackers@lists.postgresql.org; Sun, 09 Dec 2018 19:07:43 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gW4QS-00033J-Im for pgsql-hackers@postgresql.org; Sun, 09 Dec 2018 19:07:41 +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 wB9J7TcC019521; Sun, 9 Dec 2018 14:07:29 -0500 From: Tom Lane To: Stephen Frost cc: Michael Paquier , Postgres hackers , Amit Langote Subject: Re: pg_partition_tree crashes for a non-defined relation In-reply-to: <20181209185452.GF3415@tamriel.snowman.net> References: <20181207010406.GO2407@paquier.xyz> <20181207230540.GA12740@paquier.xyz> <6105.1544243612@sss.pgh.pa.us> <20181208065436.GC1989@paquier.xyz> <20181208134608.GY3415@tamriel.snowman.net> <20181208231507.GA1833@paquier.xyz> <20181209174815.GD3415@tamriel.snowman.net> <16590.1544378743@sss.pgh.pa.us> <20181209185452.GF3415@tamriel.snowman.net> Comments: In-reply-to Stephen Frost message dated "Sun, 09 Dec 2018 13:54:52 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <19519.1544382449.1@sss.pgh.pa.us> Date: Sun, 09 Dec 2018 14:07:29 -0500 Message-ID: <19520.1544382449@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Stephen Frost writes: > * Tom Lane (tgl@sss.pgh.pa.us) wrote: >> ... especially in code that's highly unlikely to break once written. > I don't entirely buy off on the argument that it's code that's 'highly > unlikely to break once written' though- we do add new relkinds from time > to time, for example. Perhaps we could have these functions run just > once per relkind. Well, the relevant code is likely to be "if relkind is not x, y, or z, then PG_RETURN_NULL". If we add a new relkind and forget to consider the function, the outcome is a NULL result that perhaps should not have been NULL ... but a test like this won't help us notice that. regards, tom lane