> I looked into the bug reported by Cott Lang that pg_type.typowner is
> incorrect for a table's toast table after a rewriting ALTER TYPE
> The obvious fix involves adding an ownerid parameter to TypeCreate,
> but I'm a tad worried about whether this will break any third-party
> add-on code. Does anyone know of non-core code that calls TypeCreate?
I started back-patching this and found out that 8.0 and 7.4 actually
have a worse form of the problem: the toast table's pg_class row also
shows the altering user's ID instead of the table owner's ID. (Hey,
at least it's consistent with the pg_type row ;-).) The reason for
the change is that we noticed a slight variant on the issue here:
at which point we fixed things so that indexes and toast tables were
certain to inherit their ownership from the parent table. But we
(I) forgot that the toast table also has a pg_type row with that info.
To fix this via a straightforward backport would mean also altering the
signature of heap_create_with_catalog() in 8.0/7.4 --- it takes an
ownerid parameter in 8.1+ but not in the older branches. That seems
like it increases the risk of breaking third-party code noticeably.
There are a number of options at this point, including fixing the
problem only in HEAD, fixing back to 8.1 but no further, or making
wrapper functions in the back branches to preserve the existing
argument lists of heap_create_with_catalog and/or TypeCreate.
I'm not really eager to do the wrapper-function bit; it doesn't quite
seem like this bug is worth that, since it's been there basically
forever with few complaints.
regards, tom lane
In response to
pgsql-hackers by date
|Next:||From: Markus Wanner||Date: 2009-02-23 20:13:33|
|Subject: Re: Hadoop backend?|
|Previous:||From: Tom Lane||Date: 2009-02-23 18:35:51|
|Subject: Re: GIN fast insert |