Cleanup postgres roles and databases
We have a whole bunch of postgres users/roles and databases that don't seem to be relevant anymore. We should cleanup what is not needed anymore.
We have these databases:
gitlabhq_production=# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
---------------------+---------------+----------+---------+---------+---------------------------------
gitlab_repmgr | gitlab_repmgr | UTF8 | C.UTF-8 | C.UTF-8 |
gitlabhq_production | gitlab | UTF8 | C.UTF-8 | C.UTF-8 | =Tc/gitlab +
| | | | | gitlab=CTc/gitlab +
| | | | | readonly=c/gitlab +
| | | | | gitlab_geo_fdw=c/gitlab
patroni_pre_detach | gitlab-psql | UTF8 | C.UTF-8 | C.UTF-8 |
postgres | gitlab-psql | UTF8 | C.UTF-8 | C.UTF-8 | =Tc/"gitlab-psql" +
| | | | | "gitlab-psql"=CTc/"gitlab-psql"
template0 | gitlab-psql | UTF8 | C.UTF-8 | C.UTF-8 | =c/"gitlab-psql" +
| | | | | "gitlab-psql"=CTc/"gitlab-psql"
template1 | gitlab-psql | UTF8 | C.UTF-8 | C.UTF-8 | =c/"gitlab-psql" +
| | | | | "gitlab-psql"=CTc/"gitlab-psql"
(6 rows)
Those are not needed anymore (to be updated as we go):
patroni_pre_detach
gitlab_repmgr
We have these users:
gitlabhq_production=# \du
List of roles
Role name | Attributes | Member of
-------------------+------------------------------------------------------------+-----------
analytics | | {}
chatops | 10 connections | {}
gitlab | | {}
gitlab-consul | | {}
gitlab-monitor | Superuser | {}
gitlab-psql | Superuser, Create role, Create DB, Replication, Bypass RLS | {}
gitlab-replicator | Replication | {}
gitlab-superuser | Superuser, Replication | {}
gitlab_geo_fdw | | {}
gitlab_replicator | Replication | {}
gitlab_repmgr | Superuser, Replication | {}
pgbouncer | | {}
postgres_exporter | | {}
readonly | | {}
slony | Superuser, Replication | {}
Those are not needed any more (to be updated as we go):
slony
gitlab_repmgr
Open questions:
-
Why do we have gitlab-replicator
andgitlab_replicator
? -
Who uses readonly
?
cc @yguo @cshobe @Finotto @ahmadsherif