Re: ALTER TABLE OWNER: change indexes

From: Neil Conway <nconway(at)klamath(dot)dyndns(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: ALTER TABLE OWNER: change indexes
Date: 2002-02-26 00:51:57
Message-ID: 1014684717.531.45.camel@jiro
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

On Mon, 2002-02-25 at 18:48, Tom Lane wrote:
> Neil Conway <nconway(at)klamath(dot)dyndns(dot)org> writes:
> > Additionally, if someone eventually fixes the index-ownership situation,
> > the changes to command.c to remove the index recursion are trivial.
>
> ... but won't necessarily get done. More to the point, they may confuse
> someone who's trying to refactor the code: without careful thought, he
> might think he needs to support recursion over indexes as well as child
> tables.

Not if the code includes a comment (as it does) that the recursion is
intended _only_ to support changing the ownership of any indexes which
belong to the table.

IMHO, it's not confusing at all: in the current code, indexes have
owners, and should be owned by the owner of the table they belong to.
The patch makes this consistent; without the patch, one might conclude
that there are reasonable situations in the owner of a table should not
own its indexes, which is incorrect AFAIK.

BTW, should ownership be removed from sequences as well?

> > This patch also includes some refactoring and code cleanups that are
> > useful in any case.
>
> Sure. Please resubmit just that part.

Okay, I've attached a patch which implements this.

I think it is still a bad idea to leave code that is _known_ to be
broken in the tree, waiting for a possible future enhancement that no
one has committed to writing. But it's your call -- please apply either
this patch, or the previous one (-3) as you see fit.

Cheers,

Neil

--
Neil Conway <neilconway(at)rogers(dot)com>
PGP Key ID: DB3C29FC

Attachment Content-Type Size
alter_index_owner-4.patch text/x-patch 6.7 KB

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2002-02-26 01:55:24 Re: ALTER TABLE OWNER: change indexes
Previous Message Peter Eisentraut 2002-02-26 00:04:25 Re: ALTER TABLE OWNER: change indexes