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
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
In response to
pgsql-patches by date
|Next:||From: Peter Eisentraut||Date: 2002-02-24 23:20:09|
|Subject: Re: ALTER TABLE OWNER: change indexes |
|Previous:||From: Neil Conway||Date: 2002-02-24 22:04:34|
|Subject: Re: ALTER TABLE OWNER: change indexes|