Skip site navigation (1) Skip section navigation (2)

Re: Okay to change TypeCreate() signature in back branches?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Okay to change TypeCreate() signature in back branches?
Date: 2009-02-23 19:53:24
Message-ID: 26123.1235418804@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackers
I wrote:
> 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
> command.
> ...
> 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:
http://archives.postgresql.org/pgsql-hackers/2005-08/msg00906.php
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.

Comments?

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: Markus WannerDate: 2009-02-23 20:13:33
Subject: Re: Hadoop backend?
Previous:From: Tom LaneDate: 2009-02-23 18:35:51
Subject: Re: GIN fast insert

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group