Re: ALTER TABLE OWNER: change indexes - Mailing list pgsql-patches

From Neil Conway
Subject Re: ALTER TABLE OWNER: change indexes
Date
Msg-id 1014684717.531.45.camel@jiro
Whole thread Raw
In response to Re: ALTER TABLE OWNER: change indexes  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: ALTER TABLE OWNER: change indexes
Re: ALTER TABLE OWNER: change indexes
Re: ALTER TABLE OWNER: change indexes
List pgsql-patches
On Mon, 2002-02-25 at 18:48, Tom Lane wrote:
> Neil Conway <nconway@klamath.dyndns.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@rogers.com>
PGP Key ID: DB3C29FC

Attachment

pgsql-patches by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: ALTER TABLE OWNER: change indexes
Next
From: Bruce Momjian
Date:
Subject: Re: ALTER TABLE OWNER: change indexes