From: Michael Paquier <michael@paquier.xyz>
To: Amit Langote <amitlangote09@gmail.com>
Cc: exclusion@gmail.com, PostgreSQL mailing lists <pgsql-bugs@lists.postgresql.org>
Cc: Alvaro Herrera <alvherre@2ndquadrant.com>
Subject: Re: BUG #16276: Server crash on an invalid attempt to attach a partition to an index
Date: Tue, 3 Mar 2020 14:01:22 +0900
Message-ID: <20200303050122.GG32059@paquier.xyz> (raw)
In-Reply-To: <CA+HiwqFQHAN9ewYWn_sDLGyusv0Q-1FGnRQFGmXt8HNcAEPmsQ@mail.gmail.com>
References: <16276-5cd1dcc8fb8be7b5@postgresql.org>
<20200226080624.GH17153@paquier.xyz>
<20200227023120.GC1969@paquier.xyz>
<CA+HiwqFziODja7kVzp5M7t2XfnUT-nxxqEse5eQ2PR4Z0JpLvQ@mail.gmail.com>
<20200227124952.GC403330@paquier.xyz>
<20200302033921.GC32059@paquier.xyz>
<CA+HiwqFQHAN9ewYWn_sDLGyusv0Q-1FGnRQFGmXt8HNcAEPmsQ@mail.gmail.com>
On Mon, Mar 02, 2020 at 07:39:44PM +0900, Amit Langote wrote:
> Done, please see attached.
Thanks. There are actually some safeguards in ATPrepCmd()@tablecmds.c
when calling ATSimplePermissions(). However, as this is checked for
both (ATT_TABLE | ATT_PARTITIONED_INDEX) then it would not blow up as
ALTER INDEX and ALTER TABLE use the same code path. Using DETACH
partition triggers this code path's error though, making the hint
added in your patch actually correct.
So, applied this stuff down to 11, with test cases on all branches. I
have added a test case with ALTER TABLE DETACH PARTITION for an index
while on it. As the error is triggered at transformation time which
is a tad more generic than the work done in tablecmds.c for each
command, I have also removed the error hint and kept the code
simpler.
--
Michael
Attachments:
signature.asc (application/pgp-signature, 832B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: michael@paquier.xyz, amitlangote09@gmail.com, pgsql-bugs@lists.postgresql.org, alvherre@2ndquadrant.com
Subject: Re: BUG #16276: Server crash on an invalid attempt to attach a partition to an index
In-Reply-To: <20200303050122.GG32059@paquier.xyz>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox