pgsql: ALTER TABLE OWNER must change the ownership of the table's

From: tgl(at)svr1(dot)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: ALTER TABLE OWNER must change the ownership of the table's
Date: 2005-08-04 01:09:30
Message-ID: 20050804010930.91146529FC@svr1.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Log Message:
-----------
ALTER TABLE OWNER must change the ownership of the table's rowtype too.
This was not especially critical before, but it is now that we track
ownership dependencies --- the dependency for the rowtype *must* shift
to the new owner. Spotted by Bernd Helmle.
Also fix a problem introduced by recent change to allow non-superusers
to do ALTER OWNER in some cases: if the table had a toast table, ALTER
OWNER failed *even for superusers*, because the test being applied would
conclude that the new would-be owner had no create rights on pg_toast.
A side-effect of the fix is to disallow changing the ownership of indexes
or toast tables separately from their parent table, which seems a good
idea on the whole.

Modified Files:
--------------
pgsql/doc/src/sgml/ref:
alter_table.sgml (r1.78 -> r1.79)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/doc/src/sgml/ref/alter_table.sgml.diff?r1=1.78&r2=1.79)
pgsql/src/backend/commands:
tablecmds.c (r1.165 -> r1.166)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/tablecmds.c.diff?r1=1.165&r2=1.166)
typecmds.c (r1.77 -> r1.78)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/typecmds.c.diff?r1=1.77&r2=1.78)
pgsql/src/include/commands:
typecmds.h (r1.12 -> r1.13)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/include/commands/typecmds.h.diff?r1=1.12&r2=1.13)
pgsql/src/test/regress/expected:
dependency.out (r1.1 -> r1.2)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/expected/dependency.out.diff?r1=1.1&r2=1.2)
pgsql/src/test/regress/sql:
dependency.sql (r1.1 -> r1.2)
(http://developer.postgresql.org/cvsweb.cgi/pgsql/src/test/regress/sql/dependency.sql.diff?r1=1.1&r2=1.2)

Browse pgsql-committers by date

  From Date Subject
Next Message James William Pye 2005-08-04 02:28:39 python - lo: Add server options, process, and SSL requirement options.
Previous Message James William Pye 2005-08-03 23:20:40 python - ex: Add code and prime unittests.