PostgreSQL : "ALTER SCHEMA schema_name OWNER TO role_name" is stuck

44 Views Asked by At

In my case it is required to change owner for schema in PostgreSQL database, I used statement:

ALTER SCHEMA schema_name OWNER TO role_name

but the statement is running and running and running... During the day re-started it at least twice after more than 3 hours running time. Looks like something is locked and it is preventing statement finishing. However after several queries to pg_locks/pg_class/pg_namespace I didnt find anything that would be a reason for the lock.

Please, share you expirience how to manage/investigate such cases.

1

There are 1 best solutions below

0
Andrey K On

For now the case is resolved : once one of my collegue switched off his PC then my statement finished successfully.