canonical / canonical/postgresql-operator

The `admin` `extra-user-role` via `data-integrator` doesn't allow creating roles

Open
#698 9 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
20
Forks
36
Avg merge
4d 15h
Merged PRs (30d)
30

Description

## Steps to reproduce

1. `juju deploy postgresql --channel 14/stable`
2. `juju deploy data-integrator`
3. `juju config data-integrator database-name='mydatabase' extra-user-roles='admin'`
4. `juju integrate data-integrator postgresql`
5. `juju run data-integrator/leader get-credentials`
6. `juju ssh --container postgresql postgresql/leader bash`
7. `psql --host=10.146.64.52 --username=operator --password postgres`
8. `\du`

## Expected behavior

```
postgres=# \du
List of roles
Role name | Attributes | Member of
-------------+------------------------------------------------------------+--------------------------------------
...
relation-27 | Create DB, Create role | {admin}
```

## Actual behavior

```
postgres=# \du
List of roles
Role name | Attributes | Member of
-------------+------------------------------------------------------------+--------------------------------------
...
relation-27 | Create DB | {admin}
```

## Versions

Operating system: ubuntu@22.04

Juju CLI: 3.5.3

Juju agent: 3.5.3

Charm revision: postgresql 14.12 active 3 postgresql 14/stable 468 yes

## Log output

## Additional context

Creating an admin user, one would expect it to have access to create roles in addition to creating databases. Unfortunately, that is not the case and it seems restricted to only being allowed to create dateabases.

To work around this, I've had to run:

```
ALTER USER "relation-27" CREATEROLE;
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.