I'm the founder of Kilimanjaro , and this week's note is from the unglamorous end of the job: tearing down.
When a customer project is removed, we remove the database role that belonged to it. It is the last step of a cleanup that is supposed to leave nothing behind. One day that last step started failing, and it kept failing in a way that made no sense for about an afternoon.
The symptom
The cleanup did what every Postgres guide says to do:
DROP OWNED BY r ; DROP ROLE r ;
Enter fullscreen mode
Exit fullscreen mode
DROP OWNED reported success. DROP ROLE then failed, every time:
ERROR: role "r" cannot be dropped because some objects depend on it DETAIL: privileges for function pg_advisory_lock(bigint)
Enter fullscreen mode
Exit fullscreen mode
That message is the whole mystery. DROP OWNED had just said it removed everything the role owned and every privilege it held.…