@@ -5,39 +5,54 @@ author: jonels-msft
5
5
ms.author : jonels
6
6
ms.service : postgresql
7
7
ms.topic : conceptual
8
- ms.date : 11/04 /2019
8
+ ms.date : 1/8 /2019
9
9
---
10
10
11
11
# Create users in Azure Database for PostgreSQL - Hyperscale (Citus)
12
12
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 ) .
18
19
19
20
## The server admin account
20
21
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:
23
26
24
27
* 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 `
28
31
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.
36
35
37
- ## How to create additional users
36
+ Permissions for the ` citus ` role:
38
37
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.
41
56
42
57
1 . Go to the ** Roles** page for your Hyperscale server group, and click ** + Add** :
43
58
@@ -48,36 +63,28 @@ add a user, use the Azure portal interface.
48
63
![ Add role] ( media/howto-hyperscale-create-users/2-add-user-fields.png )
49
64
50
65
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.
62
69
63
- ## How to modify privileges for role
70
+ ## How to modify privileges for user role
64
71
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
66
73
privileges. To modify user privileges, use standard PostgreSQL commands, using
67
74
a tool such as PgAdmin or psql. (See [ connecting with
68
75
psql] ( quickstart-create-hyperscale-portal.md#connect-to-the-database-using-psql )
69
76
in the Hyperscale (Citus) quickstart.)
70
77
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:
72
79
73
80
``` sql
74
81
GRANT SELECT ON mytable TO db_user;
75
82
```
76
83
77
84
Hyperscale (Citus) propagates single-table GRANT statements through the entire
78
85
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:
81
88
82
89
``` sql
83
90
-- applies to the coordinator node
@@ -89,6 +96,16 @@ SELECT run_command_on_workers(
89
96
);
90
97
```
91
98
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
+
92
109
## Next steps
93
110
94
111
Open the firewall for the IP addresses of the new users' machines to enable
0 commit comments