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 1gW3Ck-0003ZY-Cu for pgsql-hackers@arkaria.postgresql.org; Sun, 09 Dec 2018 17:49:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gW3Cj-0007GH-4Z for pgsql-hackers@arkaria.postgresql.org; Sun, 09 Dec 2018 17:49:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gW3Ci-0007FD-U5 for pgsql-hackers@lists.postgresql.org; Sun, 09 Dec 2018 17:49:20 +0000 Received: from tamriel.snowman.net ([2001:470:e38f::11]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gW3Ch-0000xb-0e for pgsql-hackers@postgresql.org; Sun, 09 Dec 2018 17:49:20 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id 2DD295F7A0; Sun, 9 Dec 2018 12:49:18 -0500 (EST) Date: Sun, 9 Dec 2018 12:49:18 -0500 From: Stephen Frost To: Michael Paquier Cc: Tom Lane , Postgres hackers , Amit Langote Subject: Re: pg_partition_tree crashes for a non-defined relation Message-ID: <20181209174917.GE3415@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> <20181208235926.GB1833@paquier.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Ynnwbxx2IemoHSwo" Content-Disposition: inline In-Reply-To: <20181208235926.GB1833@paquier.xyz> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Ynnwbxx2IemoHSwo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Greetings, * Michael Paquier (michael@paquier.xyz) wrote: > On Sun, Dec 09, 2018 at 08:15:07AM +0900, Michael Paquier wrote: > > On Sat, Dec 08, 2018 at 08:46:08AM -0500, Stephen Frost wrote: > >> We should really have a more clearly defined policy around this, but my > >> recollection is that we often prefer to return NULL rather than throwi= ng > >> an error for the convenience of people doing things like querying > >> pg_class using similar functions. > >=20 > > Yes, that's visibly right. At least that's what I can see from the > > various pg_get_*def and pg_*_is_visible. Returning NULL would indeed > > be more consistent. >=20 > Thinking more about your argument, scanning fully pg_class is quite > sensible as well because there is no need to apply an extra qual on > relkind, so let's change the function as you suggest, by returning NULL > on invalid relation type. Any opinions about the attached then which > does the switch? Looks alright on a quick glance, but shouldn't you also update the comment..? Thanks! Stephen --Ynnwbxx2IemoHSwo Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJcDVWdAAoJEO1sijiDR2RVLPsQALAwZYyoLfHN6KGfIWBoFXIU XkGcnFgI/+5+htaq60Tewgirx7U/hEZEahJKbqnU+FTMV0NZ3oPt6Xf6QRZQdcMH 8Sa4AIyEiFkW/kynOxBRc7cFZ9IJXg6vJliOuOr8kOun7hykxfqZiSAS9YR20geJ os7mQnz93kswXBY1rrC4HEkbPkWJSmriXprgc0cjnvGOP7dShdF34wvVDxyyYHBj t6vJcM1WgWsI+trWiTvkH17KVc+kPWmGdHGvnyvaBT60E3s6RWHzRp7EOyQ7eLgb uDw3KSHhJe79ooQH+FIY/Q0503nNsNfLeaRSX81Y6i32aBGEeD92ygIdezF3DEsi dRwcx5A4Fie2fcR8DqWzpbCt+KD2D3n82FEEPnTdm//CiM2rJ9Y47WmbOsLjG6PP v7M9IKtM5Fzf4HVxyIOvr9tGGHgvultZ8bGHhvzm5ysyO37suhdZbfZyTFhiQ1xD evtVz/EG9IFDx1mHwyj5rMJoQRuSI4ZujQ+JJ9xvvLdCh0rBNPiyVzrOlHz4GQOQ zyvYuVo6ChbCItmeIL9zLJTuB1dzGKPB7b9XOU2GuMoslpORQ/M7J9pceyzskvMk BzKX3oGKusOCaHV4XeecYTYbQW93LqhdXVnOhwZWtVPNwd45oPEMXP1lHiMdWlkF kTp+PA3e9ZEadHor69aP =/bqr -----END PGP SIGNATURE----- --Ynnwbxx2IemoHSwo--