Skip to content

Commit 10c712e

Browse files
authored
Merge pull request #99919 from jonels-msft/role-mgmt-back
Restore role mgmt howto to TOC
2 parents e294f65 + a47cfac commit 10c712e

File tree

2 files changed

+56
-37
lines changed

2 files changed

+56
-37
lines changed

articles/postgresql/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,8 @@
281281
href: howto-read-replicas-cli.md
282282
- name: Hyperscale (Citus)
283283
items:
284+
- name: Create users
285+
href: howto-hyperscale-create-users.md
284286
- name: Scale
285287
href: howto-hyperscale-scaling.md
286288
- name: Manage firewall

articles/postgresql/howto-hyperscale-create-users.md

Lines changed: 54 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -5,39 +5,54 @@ author: jonels-msft
55
ms.author: jonels
66
ms.service: postgresql
77
ms.topic: conceptual
8-
ms.date: 11/04/2019
8+
ms.date: 1/8/2019
99
---
1010

1111
# Create users in Azure Database for PostgreSQL - Hyperscale (Citus)
1212

13-
This article describes how you can create users within a Hyperscale (Citus)
14-
server group. To learn instead about Azure subscription users and their
15-
privileges, visit the [Azure role based access control (RBAC)
16-
article](../role-based-access-control/built-in-roles.md) or review [how to
17-
customize roles](../role-based-access-control/custom-roles.md).
13+
> [!NOTE]
14+
> The term "users" refers to users within a Hyperscale (Citus)
15+
> server group. To learn instead about Azure subscription users and their
16+
> privileges, visit the [Azure role based access control (RBAC)
17+
> article](../role-based-access-control/built-in-roles.md) or review [how to
18+
> customize roles](../role-based-access-control/custom-roles.md).
1819
1920
## The server admin account
2021

21-
A newly created Hyperscale (Citus) server group comes with several roles
22-
pre-defined:
22+
The PostgreSQL engine uses
23+
[roles](https://www.postgresql.org/docs/current/sql-createrole.html) to control
24+
access to database objects, and a newly created Hyperscale (Citus) server group
25+
comes with several roles pre-defined:
2326

2427
* The [default PostgreSQL roles](https://www.postgresql.org/docs/current/default-roles.html)
25-
* *azure_pg_admin*
26-
* *postgres*
27-
* *citus*
28+
* `azure_pg_admin`
29+
* `postgres`
30+
* `citus`
2831

29-
The PostgreSQL engine uses privileges to control access to database objects, as
30-
discussed in the [PostgreSQL product
31-
documentation](https://www.postgresql.org/docs/current/static/sql-createrole.html).
32-
Your server admin user, *citus*, is a member of the *azure_pg_admin* role.
33-
However, it isn't part of the *postgres* (super user) role. Since Hyperscale
34-
is a managed PaaS service, only Microsoft is part of the super user role. The
35-
*citus* user has limited permissions and can't e.g. create new databases.
32+
Since Hyperscale is a managed PaaS service, only Microsoft can sign in with the
33+
`postgres` super user role. For limited administrative access, Hyperscale
34+
provides the `citus` role.
3635

37-
## How to create additional users
36+
Permissions for the `citus` role:
3837

39-
The *citus* admin account lacks permission to create additional users. To
40-
add a user, use the Azure portal interface.
38+
* Read all configuration variables, even variables normally visible only to
39+
superusers.
40+
* Read all pg\_stat\_\* views and use various statistics-related extensions --
41+
even views or extensions normally visible only to superusers.
42+
* Execute monitoring functions that may take ACCESS SHARE locks on tables,
43+
potentially for a long time.
44+
* [Create PostgreSQL extensions](concepts-hyperscale-extensions.md) (because
45+
the role is a member of `azure_pg_admin`).
46+
47+
Notably, the `citus` role has some restrictions:
48+
49+
* Can't create roles
50+
* Can't create databases
51+
52+
## How to create additional user roles
53+
54+
As mentioned, the `citus` admin account lacks permission to create additional
55+
users. To add a user, use the Azure portal interface.
4156

4257
1. Go to the **Roles** page for your Hyperscale server group, and click **+ Add**:
4358

@@ -48,36 +63,28 @@ add a user, use the Azure portal interface.
4863
![Add role](media/howto-hyperscale-create-users/2-add-user-fields.png)
4964

5065
The user will be created on the coordinator node of the server group,
51-
and propagated to all the worker nodes.
52-
53-
## How to delete a user or change their password
54-
55-
Go to the **Roles** page for your Hyperscale server group, and click the
56-
ellipses **...** next to a user. The ellipses will open a menu to delete
57-
the user or reset their password.
58-
59-
![Edit a role](media/howto-hyperscale-create-users/edit-role.png)
60-
61-
The *citus* role is privileged and can't be deleted.
66+
and propagated to all the worker nodes. Roles created through the Azure
67+
portal have the `LOGIN` attribute, which means they are true users who
68+
can sign in to the database.
6269

63-
## How to modify privileges for role
70+
## How to modify privileges for user role
6471

65-
New roles are commonly used to provide database access with restricted
72+
New user roles are commonly used to provide database access with restricted
6673
privileges. To modify user privileges, use standard PostgreSQL commands, using
6774
a tool such as PgAdmin or psql. (See [connecting with
6875
psql](quickstart-create-hyperscale-portal.md#connect-to-the-database-using-psql)
6976
in the Hyperscale (Citus) quickstart.)
7077

71-
For example, to allow *db_user* to read *mytable*, grant the permission:
78+
For example, to allow `db_user` to read `mytable`, grant the permission:
7279

7380
```sql
7481
GRANT SELECT ON mytable TO db_user;
7582
```
7683

7784
Hyperscale (Citus) propagates single-table GRANT statements through the entire
7885
cluster, applying them on all worker nodes. However GRANTs that are system-wide
79-
(e.g. for all tables in a schema) need to be run on every date node. Use the
80-
*run_command_on_workers()* helper function:
86+
(for example, for all tables in a schema) need to be run on every date node. Use the
87+
`run_command_on_workers()` helper function:
8188

8289
```sql
8390
-- applies to the coordinator node
@@ -89,6 +96,16 @@ SELECT run_command_on_workers(
8996
);
9097
```
9198

99+
## How to delete a user role or change their password
100+
101+
To update a user, visit the **Roles** page for your Hyperscale server group,
102+
and click the ellipses **...** next to the user. The ellipses will open a menu
103+
to delete the user or reset their password.
104+
105+
![Edit a role](media/howto-hyperscale-create-users/edit-role.png)
106+
107+
The `citus` role is privileged and can't be deleted.
108+
92109
## Next steps
93110

94111
Open the firewall for the IP addresses of the new users' machines to enable

0 commit comments

Comments
 (0)