Drop schema cascade? #621
-
Not sure if it is a bug or not. Our situation might be unique. We create personal schemas on first login with personal account that has been created with ldap2pg. This is done with a login trigger. If user leaves the organization then their account is no longer part of LDAP group used by ldap2pg to create/drop accounts. When ldap2pg runs I see it reassigns objects but it does not do anything with the schema and then cannot cleanup the user appropriately. 2024-04-08 15:08:20,743 CHANGE: Terminate running sessions for my_user. my_database=# drop schema my_user; Is there a way to have drop schema cascade? I saw notes about it in #171 but that was closed |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Is |
Beta Was this translation helpful? Give feedback.
-
However - @bersace - we would want these schemas to be dropped and not just have the ownership changed - is that possible through ldap2pg tool? |
Beta Was this translation helpful? Give feedback.
ldap2pg will reassign the schema to database owner before dropping user. To do this, ldap2pg loops on every databases returned by
databases_query
. Ifmy_database
is not returned bydatabases_query
, ldap2pg won't reassign schemas in this database. Thus Postgres will refuse to drop role.