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

From Tom Lane
Subject Re: ALTER TABLE OWNER: change indexes
Date
Msg-id 12921.1014590587@sss.pgh.pa.us
Whole thread Raw
In response to Re: ALTER TABLE OWNER: change indexes  (Neil Conway <nconway@klamath.dyndns.org>)
Responses Re: ALTER TABLE OWNER: change indexes  (Peter Eisentraut <peter_e@gmx.net>)
Re: ALTER TABLE OWNER: change indexes  (Neil Conway <nconway@klamath.dyndns.org>)
List pgsql-patches
BTW, I forgot to inquire about *why* you needed to look up a relation
name.  As things stand I think you've coded it okay, but this will need
to change for schemas: a relation name isn't going to be a unique
identifier much longer.

It'd probably be best to redesign the ALTER TABLE routines so that
the recursive execution routine accepts a relation OID rather than a
relation name, with a front-end routine that does a one-time name-to-
OID lookup.  Recursion using OID will be simpler than recursion using
name, for both child-table and index cases.  And it won't break for
schemas.

Perhaps this could be done as part of the overall refactoring of the
ALTER code that someone (I forget who) was going to look at doing.

This doesn't need to be done just to make this patch acceptable, but
I thought I'd better mention that it needs to be done soon.

Another point that maybe does need immediate attention: as coded,
reassignment of ownership of a table won't affect the associated
TOAST table, if any.  Should it?

            regards, tom lane

pgsql-patches by date:

Previous
From: Neil Conway
Date:
Subject: Re: ALTER TABLE OWNER: change indexes
Next
From: Peter Eisentraut
Date:
Subject: Re: ALTER TABLE OWNER: change indexes