2012-03-23 16 views
12

Daha önce 'xyz' adı taşıyan şema sahibi olan 'xyz' rolünü düşürmeye çalışıyorum. Şema sahipliğini aşağıdaki gibi değiştirdim ve her durumda (tüm tablolar süper kullanıcı gücüyle farklı bir kullanıcı tarafından oluşturulmuş olsa da) yeniden sahiplenmiş mülkiyeti çalıştırdım.PostgreSQL drop rolü varsayılan ayrıcalıklardan dolayı başarısız oluyor

alter schema xyz owner to postgres; 
reassign owned by xyz to postgres; 
alter default privileges in schema seeds revoke all on tables from xyz cascade; 
alter default privileges in schema seeds revoke all on sequences from xyz cascade; 
alter default privileges in schema seeds revoke all on functions from xyz cascade; 

Ve hala hata alıyorum: Ben bütün bu çalıştırmak

drop role xyz; 
ERROR: role "xyz" cannot be dropped because some objects depend on it 
DETAIL: owner of default privileges on new relations belonging to role xyz in schema xyz 

Ayrıca Bilginize:

postgres=# \du rsi 
List of roles 
Role name | Attributes | Member of 
-----------+----------------+----------- 
rsi  | No inheritance | {} 

ben eksik? Herhangi bir yardım takdir edilecektir! Teşekkürler!! yani bu durumda DROP OWNED BY ilgili belgelerinden

If you wish to drop a role for which the default privileges have been altered, it is necessary to reverse the changes in its default privileges or use DROP OWNED BY to get rid of the default privileges entry for the role.

Başka worthy mention da Dolayısıyla bu

Because DROP OWNED only affects the objects in the current database, it is usually necessary to execute this command in each database that contains objects owned by a role that is to be removed.

olduğunu kilometre değişebilir: ALTER DEFAULT PRIVILEGES üzerine PostgreSQL documentation Alındığı

+0

Bunu dba.stackexchange.com'a taşıyın? –

cevap

13

, bölüm Notları Daha fazla DB'de bildirimi vermeniz gerekebilir.

Soruda belirtilenlerle aynı mesajları aldığım halde, DROP OWNED BY bildirimini denedim ve çalıştı. Bu yardımcı olur umarım!

+5

'' BİZİ TARAFINDAN DOĞRU, '' DROP KULLANICI usr ''; – cvsguimaraes

İlgili konular