Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gH1UT-0001ZT-PV for pgsql-bugs@arkaria.postgresql.org; Mon, 29 Oct 2018 06:57:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gH1UR-0004Nz-B4 for pgsql-bugs@arkaria.postgresql.org; Mon, 29 Oct 2018 06:57:31 +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.89) (envelope-from ) id 1gH1UP-0004NS-M7 for pgsql-bugs@lists.postgresql.org; Mon, 29 Oct 2018 06:57:31 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1gH1UI-00066G-JS for pgsql-bugs@lists.postgresql.org; Mon, 29 Oct 2018 06:57:29 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 1138D21BFD; Mon, 29 Oct 2018 02:57:20 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Mon, 29 Oct 2018 02:57:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=HM0QzFXYNNXLVl6XxyOHexXcDYR qzDnQBjQr+9q3lbI=; b=hHtp298acFY9K5eYgPZsaqpOQnOWwAeqRkZlhEZVsbM sjKoCIaqqCz03qE+KbfaJLO4RPvFtmSlU3A20LcwLdJ9VnRouylqtvWdclvPKjns HzxqpgFglyHiYymkPB0tqfKkATGlrcOaqjKW44coczAwF3QuhV4j731iy9axijgB PsVEHBEL1Yex9QEKWUxmMj9Hqsz0ssTKIydd6dg4TlXeDxKs4fiS/71ZO+ckgHUj AxB64l0ms4RzyPtTxHOdaSpv41P5qgblR9oWr+c+lXst20bP7sXwDxIWu5cb9vgs PxoNzYVgxiKLU7/yOkkdhedmQyX49CQSB3080V7GEtg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=HM0QzF XYNNXLVl6XxyOHexXcDYRqzDnQBjQr+9q3lbI=; b=Fm4YRE3OFefNFP0gOpoYEy SZSR7c7Zv8jdFKDiRdxtHOtfWxMSp/RcKaNEXRSYYoaqm6sb3qpJHm9cNptaNk+I /KDvykfgWElkbyGw5Sv+RY7o4h6o3bAW8npy0wfac11sUDYAJnvt1qD0PcsXzCN2 FZO9mlIWCui57r2Lbjgkfs9cU3YaCa/P5+vVmsEBpeezNrH8t+JG6lBuvhPHEApA JA0nmXpgvCpZEFTGQAKYG+DlgI683SP2as7w/RZYjVNzsBKjKAwr4G5Rp0p9mOh2 vLo/s7BJICfaRsQm2yQYDjDICEj56YGfKPqGE5XhVplukYG0ZoQLUpKhsQdeFbig == X-ME-Sender: X-ME-Proxy: Received: from paquier.xyz (c137162.net61215.cablenet.ne.jp [61.215.137.162]) by mail.messagingengine.com (Postfix) with ESMTPA id 73D98E455F; Mon, 29 Oct 2018 02:57:17 -0400 (EDT) Date: Mon, 29 Oct 2018 15:57:14 +0900 From: Michael Paquier To: Amit Langote Cc: Tom Lane , skaurus@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15437: Segfault during insert into declarative partitioned table with a trigger creating partition Message-ID: <20181029065714.GI14242@paquier.xyz> References: <15437-3fe01ee66bd1bae1@postgresql.org> <8213.1539917571@sss.pgh.pa.us> <20181029033117.GE14242@paquier.xyz> <39fc3c42-d34e-794b-184e-4ff2481245e3@lab.ntt.co.jp> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Op27XXJsWz80g3oF" Content-Disposition: inline In-Reply-To: <39fc3c42-d34e-794b-184e-4ff2481245e3@lab.ntt.co.jp> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Op27XXJsWz80g3oF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 29, 2018 at 02:28:53PM +0900, Amit Langote wrote: > On 2018/10/29 12:31, Michael Paquier wrote: >> In the case of a partition, the execution state relies on the data >> inserted, so the restriction sounds fine to me. If one tries to attach >> a partition after creating a table you actually get an error: >> ERROR: 55006: cannot ALTER TABLE "check_not_in_use" because it is being >> used by active queries in this session >> CONTEXT: SQL statement "alter table check_not_in_use attach partition >> check_not_in_use1 for values IN (1);" >=20 > Yeah, I forgot to include this example in my previous emails. We may want to add a new test for this one in the same spirit as what has been sent in the previous patch. >> Other callers of CheckTableNotInUse() use command tags, which is >> inconsistent here, still I cannot think of anything better than >> CREATE TABLE "%s" PARTITION OF >> or: >> CREATE TABLE .. PARTITION OF >=20 > Maybe the latter is fine, because we want to highlight the parent table's > name, not partition's. Fine by me. -- Michael --Op27XXJsWz80g3oF Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlvWr0oACgkQnvQgOdby QH0maRAAgLmp8a3UQAXYTAFt2M474buS1MVNBydwrhEC153WKADefPdpYv1nJ2VP O7+tLLB8Mdke9LkYLiBhuAT0awlFKaiyiH4tKYBrO7FEuxNqb/E5NOH8YAbX9i7e IZlTRpCaPg+b1sZuwQ/ZxRR4f6ElKVmhyAjvzepKkNNaxwOfEYKfsnTis455yk70 AZIofn1aAh8djjGHS/cUkpbLg90OSwI2GWVeUF9FcIwt5yvuMAXcN+M0bW+x6AkG wHsXO7ZGVFV2NeW8LWfWJ0Re4O0z4lalOLEpHOuPMOTDBvmKJe2umE79AfGd6xzC HY6i907TMAN0BncTTT3mHl4tFgk+z+pMWtqrP35EbLfqtbpFqS61fPgNncrpWfZD avekWLJU4zh2HRHnlQEStbhVkemDKR8uSLyc4AHZ36Bi/WmD2mwceCChwTpMQqAm dbDv8lSw5Q+L+oLrDsTBXSHE+4AND0oU4K0JxkeT26It27To5Fxdyjyf0nQsZ5n7 x3sBul+IMpXj2lx+kTlG890iwVff23SaozV/3+yKSXt/img3FKuWaSkJsCzxWaIj 5rhpVw4hNOC+R/GSAK+4gP7hLlifDw6fqQBsfidkr2f1Hn0i4rTUXkgALyLhWtU8 LRG8QiDr0rQN61T0j7QnokxQGb0BCBD+3eBqKz2wDhopkEgzaBM= =RZRW -----END PGP SIGNATURE----- --Op27XXJsWz80g3oF--