diff --git a/lib/charms/postgresql_k8s/v0/postgresql.py b/lib/charms/postgresql_k8s/v0/postgresql.py index 7e6a9d7631..f2ceea76bb 100644 --- a/lib/charms/postgresql_k8s/v0/postgresql.py +++ b/lib/charms/postgresql_k8s/v0/postgresql.py @@ -35,7 +35,7 @@ # Increment this PATCH version before using `charmcraft publish-lib` or reset # to 0 if you are raising the major API version -LIBPATCH = 51 +LIBPATCH = 53 # Groups to distinguish HBA access ACCESS_GROUP_IDENTITY = "identity_access" @@ -672,7 +672,9 @@ def list_users_from_relation(self) -> Set[str]: try: with self._connect_to_database() as connection, connection.cursor() as cursor: cursor.execute( - "SELECT usename FROM pg_catalog.pg_user WHERE usename LIKE 'relation_id_%';" + "SELECT usename " + "FROM pg_catalog.pg_user " + "WHERE usename LIKE 'relation_id_%' OR usename LIKE 'relation-%';" ) usernames = cursor.fetchall() return {username[0] for username in usernames}