Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eK4ke-0006Dh-DS for pgsql-hackers@arkaria.postgresql.org; Wed, 29 Nov 2017 15:58:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eK4kc-0001D2-57 for pgsql-hackers@arkaria.postgresql.org; Wed, 29 Nov 2017 15:58:18 +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_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eK4kb-0001Cs-V2 for pgsql-hackers@lists.postgresql.org; Wed, 29 Nov 2017 15:58:18 +0000 Received: from tamriel.snowman.net ([96.255.250.162]) by magus.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1eK4kY-0004pJ-Rh for pgsql-hackers@postgresql.org; Wed, 29 Nov 2017 15:58:17 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id C92CA5F795; Wed, 29 Nov 2017 10:58:12 -0500 (EST) Date: Wed, 29 Nov 2017 10:58:12 -0500 From: Stephen Frost To: Tom Lane Cc: Robert Haas , Sergei Kornilov , "pgsql-hackers@postgresql.org" Subject: Re: using index or check in ALTER TABLE SET NOT NULL Message-ID: <20171129155812.GO4628@tamriel.snowman.net> References: <81911511895540@web58j.yandex.ru> <20171129152135.GN4628@tamriel.snowman.net> <9878.1511970441@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="kWdyt7I2kxgMqz2p" Content-Disposition: inline In-Reply-To: <9878.1511970441@sss.pgh.pa.us> User-Agent: Mutt/1.5.21 (2010-09-15) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --kWdyt7I2kxgMqz2p Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Tom, * Tom Lane (tgl@sss.pgh.pa.us) wrote: > Stephen Frost writes: > > Isn't the first concern addressed by using SPI..? >=20 > I did not look at the patch yet, but TBH if it uses SPI for sub-operations > of ALTER TABLE I think that is sufficient reason to reject it out of hand. You mean like what ALTER TABLE ... ADD FOREIGN KEY does? > Doing things that way would create way too much of a vulnerability surface > for code touching a partially-updated table. At minimum, we'd have to > blow holes in existing protections like CheckTableNotInUse, and I think > we'd be forever finding other stuff that failed to work quite right in > that context. I do not want ALTER TABLE going anywhere near the planner > or executor; I'm not even happy that it uses the parser (for index > definition reconstruction). That's more along the lines of the kind of response I was expecting given the suggestion, and perhaps a good reason to just go with the index-based lookup, when an index is available to do so with, but I'm not entirely sure how this is different from how we handle foreign keys. Thanks! Stephen --kWdyt7I2kxgMqz2p Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBCgAGBQJaHtkUAAoJEO1sijiDR2RVlSIP/i3nBBx73yHl4+I/b/HGSXUM tx6OjdaTYRxtI7B3pzRkC2EkmeZmlKOzrWEAPFTaYEG7lbXDfjaiez8axzuMd3pc 1TT6RY3g7En81SKd1zZVKTUCOJFU/pr01AkdoiHPSufRtmGRRzZt2n0YlzIcNkKM AHrMC+J6FHMZNMzh7ZohIb2NoT3BZHKvpyJC90N3nOOn26cBtV+bv6/jYutZeAhm eMrrTGItDKa2jpIuj4vHxlEIyaT2czMI+bPgS1RevPhvyS9Uw742OmQ6N18gRL0E 7nnOdm8j2Jiq7Jj93d3KeQeDfs/4qZ2vAmOIsAiOqlNEV25GEKOHYX4IJD4mv5mG mz4wGoKkzkC9L/UAuj3yrs0lcyai1RMwltK/TksZaecglVmpebxBmkVb8Y0LMu5+ Sf8ujoFvGE+1+J2x5Q/uEoi8ynUaupCqNKpu6zP2ATfYqFPi5pkMIYO4yjUZ3YYR 2RdbpdAE+ptHBgaSLpuCLNEsIEemoXBKJ86ebRzFdZ1+zS8rWHek/gOySuubfHwv u9IBvfZD0WygwPDmYAZ1XFwZEo+Xa6E2e6Ry3OwSv+b/ogvKq0o8/iwtyiwihsYb LztxNB1wg3LVv5ajTrkNME2PFDZqlK5Q6Lky0hJ2QjsY+hPgZl1bcC0MXVg51Dyf rMN3yCSugaCFYb+dTBJd =W6Aa -----END PGP SIGNATURE----- --kWdyt7I2kxgMqz2p--