Updating a PostgreSQL user
If you have a PostgreSQL user in your cluster, you can update the user's permissions and parameters. Once created, the cluster name (spec.cluster) and role name (spec.username) cannot be changed.
-
Open the
PostgresqlRoleresource, e.g., by running this command:kubectl edit PostgresqlRole <resource_name> -n <project_name>. -
Edit the parameters:
spec.membership: List of parent roles.spec.options.superuser: Superuser permissions.spec.options.login: Login permission.spec.options.createdb: Permission to create databases.spec.options.createrole: Permission to create roles.spec.options.inherit: Permission inheritance from parent roles.spec.options.replication: Permission to use replication.spec.options.bypassRLS: Row-level security policy bypass.spec.options.connectionLimit: Limit on simultaneous connections. If set to-1, there is no limit.spec.options.validUntil: Password expiration date in RFC3339 format.
-
To change the user password, update the
passwordkey value in the associated Kubernetes Secret. The name of the Secret is specified in thespec.authentication.secretNamefield of thePostgresqlRoleresource.
-
If you have not opened a project yet, select one.
-
In the left-hand menu, select PostgreSQL Clusters.
-
Select a cluster.
-
Navigate to the Users tab and select the user.
-
Click Edit.
-
Adjust the toggles and fields under Additional parameters:
- Superuser
- Allow login
- Parent roles
- Creating databases
- Creating roles
- Inheriting permissions from roles
- Replication mode
- RLS policy bypass
- Connection limit
- Password valid until
-
Click Save.
Done. The user settings have been updated.