Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop schema cascade? #606

Closed
seanzechman opened this issue Apr 9, 2024 · 1 comment
Closed

Drop schema cascade? #606

seanzechman opened this issue Apr 9, 2024 · 1 comment
Labels

Comments

@seanzechman
Copy link

seanzechman commented Apr 9, 2024

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.
2024-04-08 15:08:20,833 CHANGE: Reassign my_user's objects and purge ACL in postgres.
2024-04-08 15:08:20,834 CHANGE: Drop my_user.
2024-04-08 15:08:20,835 CRITICAL: Error while executing SQL query:
2024-04-08 15:08:20,835 CRITICAL: role "my_user" cannot be dropped because some objects depend on it
2024-04-08 15:08:20,835 CRITICAL: DETAIL: 1 object in database my_database

my_database=# drop schema my_user;
DROP SCHEMA
my_database=# drop role my_user;
DROP ROLE
my_database=# exit

Is there a way to have drop schema cascade? I saw notes about it in #171 but that was closed

@bersace
Copy link
Member

bersace commented Apr 10, 2024

Is my_database returned by databases_query ?

@dalibo dalibo locked and limited conversation to collaborators May 2, 2024
@bersace bersace converted this issue into discussion #621 May 2, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Projects
None yet
Development

No branches or pull requests

2 participants