-
- Downloads
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.
Showing
- doc/src/sgml/ref/alter_table.sgml 2 additions, 2 deletionsdoc/src/sgml/ref/alter_table.sgml
- src/backend/commands/tablecmds.c 48 additions, 26 deletionssrc/backend/commands/tablecmds.c
- src/backend/commands/typecmds.c 42 additions, 2 deletionssrc/backend/commands/typecmds.c
- src/include/commands/typecmds.h 2 additions, 1 deletionsrc/include/commands/typecmds.h
- src/test/regress/expected/dependency.out 6 additions, 2 deletionssrc/test/regress/expected/dependency.out
- src/test/regress/sql/dependency.sql 4 additions, 1 deletionsrc/test/regress/sql/dependency.sql
Loading
Please register or sign in to comment