From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | pgsql-hackers(at)postgreSQL(dot)org |
Subject: | Okay to change TypeCreate() signature in back branches? |
Date: | 2009-02-21 18:46:07 |
Message-ID: | 28223.1235241967@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
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 problem occurs because an entirely new toast table
is built during the rewrite. The correct table owner is passed to
heap_create_with_catalog(), but it doesn't get passed down to
TypeCreate(), which instead uses the current userid.
The same problem exists in CLUSTER, since it uses the same
table-rewriting logic. In the CLUSTER form it can be demonstrated clear
back to 7.4. The CLUSTER form seems particularly nasty since that's
much more likely to be executed as a superuser rather than the table
owner.
Now the ownership of a table rowtype isn't usually that important;
I'm not sure if there are any bad consequences other than the one
Cott reported, ie, pg_dump starting to complain if you drop the
superuser role that did the ALTER or CLUSTER. Still, it seems like
a must-fix issue.
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?
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Paul Sheer | 2009-02-21 20:17:30 | Hadoop backend? |
Previous Message | Frank Featherlight | 2009-02-21 13:26:39 | Service not starting: Error 1053 |