diff options
author | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2013-01-28 18:03:23 -0300 |
---|---|---|
committer | Alvaro Herrera <alvherre@alvh.no-ip.org> | 2013-01-28 18:45:50 -0300 |
commit | ee22c55f5ad2e7b7032cd6c0243254d84d4496c7 (patch) | |
tree | 162e51d5261c6c6ea0aac9f7f3de7c99f4919634 /src | |
parent | ec41b8edc1192e87f4ad05471c176cc735bda2c9 (diff) | |
download | postgresql-ee22c55f5ad2e7b7032cd6c0243254d84d4496c7.tar.gz postgresql-ee22c55f5ad2e7b7032cd6c0243254d84d4496c7.zip |
REASSIGN OWNED: handle shared objects, too
Give away ownership of shared objects (databases, tablespaces) along
with local objects, per original code intention. Try to make the
documentation clearer, too.
Per discussion about DROP OWNED's brokenness, in bug #7748.
This is not backpatched because it'd require some refactoring of the
ALTER/SET OWNER code for databases and tablespaces.
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/catalog/pg_shdepend.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/backend/catalog/pg_shdepend.c b/src/backend/catalog/pg_shdepend.c index 4a85438ff5e..e411372fec2 100644 --- a/src/backend/catalog/pg_shdepend.c +++ b/src/backend/catalog/pg_shdepend.c @@ -1325,8 +1325,12 @@ shdepReassignOwned(List *roleids, Oid newrole) { Form_pg_shdepend sdepForm = (Form_pg_shdepend) GETSTRUCT(tuple); - /* We only operate on objects in the current database */ - if (sdepForm->dbid != MyDatabaseId) + /* + * We only operate on shared objects and objects in the current + * database + */ + if (sdepForm->dbid != MyDatabaseId && + sdepForm->dbid != InvalidOid) continue; /* Unexpected because we checked for pins above */ @@ -1388,6 +1392,8 @@ shdepReassignOwned(List *roleids, Oid newrole) case OperatorFamilyRelationId: case OperatorClassRelationId: case ExtensionRelationId: + case TableSpaceRelationId: + case DatabaseRelationId: { Oid classId = sdepForm->classid; Relation catalog; |