pgsql: DROP OWNED: don't try to drop tablespaces/databases

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: DROP OWNED: don't try to drop tablespaces/databases
Date: 2013-01-28 22:32:01
Message-ID: E1TzxFB-0006Td-4q@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

DROP OWNED: don't try to drop tablespaces/databases

My "fix" for bugs #7578 and #6116 on DROP OWNED at fe3b5eb08a1 not only
misstated that it applied to REASSIGN OWNED (which it did not affect),
but it also failed to fix the problems fully, because I didn't test the
case of owned shared objects. Thus I created a new bug, reported by
Thomas Kellerer as #7748, which would cause DROP OWNED to fail with a
not-for-user-consumption error message. The code would attempt to drop
the database, which not only fails to work because the underlying code
does not support that, but is a pretty dangerous and undesirable thing
to be doing as well.

This patch fixes that bug by having DROP OWNED only attempt to process
shared objects when grants on them are found, ignoring ownership.

Backpatch to 8.3, which is as far as the previous bug was backpatched.

Branch
------
REL8_3_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/85abf1d2cf9a2e780b2187356571df4f1b86c527

Modified Files
--------------
doc/src/sgml/ref/drop_owned.sgml | 9 +++++++--
src/backend/catalog/pg_shdepend.c | 13 ++++++++-----
2 files changed, 15 insertions(+), 7 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Simon Riggs 2013-01-29 00:07:13 pgsql: Fast promote mode skips checkpoint at end of recovery.
Previous Message Alvaro Herrera 2013-01-28 22:32:00 pgsql: DROP OWNED: don't try to drop tablespaces/databases