You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CREATE ROLE readonly WITH LOGIN ENCRYPTED PASSWORD 'readonly';
46
+
47
+
-- to check all avaliable roles
48
+
>> \du
49
+
50
+
/*
51
+
By default, when you create a new database - only Superuser and creater of the db can access to it. Other users must be given access to it, if required.
52
+
*/
53
+
54
+
/************ 10) Creating users and Configuring Login *************/
55
+
56
+
-- create role and user
57
+
CREATE ROLE test_role_with_login WITH LOGIN ENCRYPTED PASSWORD 'password';
58
+
59
+
CREATEUSERtest_user_with_login WITH ENCRYPTED PASSWORD 'password';
60
+
61
+
\du
62
+
63
+
/************ Another way of creating user *********/
64
+
-- if you are not connected with postgre, there is binary command that we can use, just follow on screen questions.
65
+
createuser --interactive
66
+
67
+
/******* Altering Role *********/
68
+
AlTER ROLE test_interactive WITH ENCRYPTED PASSWORD 'password';
0 commit comments