public inbox for [email protected]  
help / color / mirror / Atom feed
From: Michael Paquier <[email protected]>
To: [email protected] <[email protected]>
Cc: Euler Taveira <[email protected]>
Cc: [email protected] <[email protected]>
Cc: Ashutosh Bapat <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: Confused comment about drop replica identity index
Date: Mon, 3 Jan 2022 16:47:17 +0900
Message-ID: <[email protected]> (raw)
In-Reply-To: <OS0PR01MB5716C0F50F48A87F281FB3B994459@OS0PR01MB5716.jpnprd01.prod.outlook.com>
References: <CAExHW5uWwcV0-=JQXYhEpnEtmwmZQsh0c1N3cxxBYRhwE9WuvQ@mail.gmail.com>
	<Yblf/[email protected]>
	<OS3PR01MB6275A10D03572E27C4E2C9769E769@OS3PR01MB6275.jpnprd01.prod.outlook.com>
	<[email protected]>
	<OS3PR01MB62750A124D384B4E96CA43F19E779@OS3PR01MB6275.jpnprd01.prod.outlook.com>
	<OS3PR01MB62750A0A1A282E9E0148172B9E7B9@OS3PR01MB6275.jpnprd01.prod.outlook.com>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<OS0PR01MB5716C0F50F48A87F281FB3B994459@OS0PR01MB5716.jpnprd01.prod.outlook.com>

On Thu, Dec 30, 2021 at 06:45:30AM +0000, [email protected] wrote:
> I think forbids DROP INDEX might not completely solve this problem. Because
> user could still use other command to delete the index, for example: ALTER
> TABLE DROP COLUMN. After dropping the column, the index on it will also be
> dropped.
> 
> Besides, user can also ALTER REPLICA IDENTITY USING INDEX "primary key", and in
> this case, when they ALTER TABLE DROP CONSTR "PRIMARY KEY", the replica
> identity index will also be dropped.

Indexes related to any other object type, like constraints, are
dropped as part of index_drop() as per the handling of dependencies.
So, by putting a restriction there, any commands would take this code
path, and fail when trying to drop an index used as a replica
identity.  Why would that be logically a problem?  We may want errors
with more context for such cases, though, as complaining about an
object not directly known by the user when triggering a different
command, like a constraint index, could be confusing.
--
Michael


Attachments:

  [application/pgp-signature] signature.asc (833B, ../[email protected]/2-signature.asc)
  download

view thread (2+ messages)

reply

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: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Confused comment about drop replica identity index
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox