File tree 1 file changed +40
-0
lines changed
1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,46 @@ psql -d your_db
42
42
CREATE EXTENSION pgdd;
43
43
```
44
44
45
+ ## Database Permissions
46
+
47
+ Create Read-only group role to assign to users
48
+ that need access to query (read-only) the PgDD objects.
49
+
50
+ ```
51
+ CREATE ROLE dd_read WITH NOLOGIN;
52
+ COMMENT ON ROLE dd_read IS 'Group role to grant read-only permissions to PgDD views.';
53
+
54
+ GRANT USAGE ON SCHEMA dd TO dd_read;
55
+ GRANT SELECT ON ALL TABLES IN SCHEMA dd TO dd_read;
56
+ ALTER DEFAULT PRIVILEGES IN SCHEMA dd GRANT SELECT ON TABLES TO dd_read;
57
+ ```
58
+
59
+ Access can now be granted to other users using:
60
+
61
+ ```
62
+ GRANT dd_read TO <your_login_user>;
63
+ ```
64
+
65
+ For read-write access.
66
+
67
+
68
+ ```
69
+ CREATE ROLE dd_readwrite WITH NOLOGIN;
70
+ COMMENT ON ROLE dd_readwrite IS 'Group role to grant write permissions to PgDD objects.';
71
+
72
+ GRANT dd_read TO dd_readwrite;
73
+
74
+ GRANT INSERT, UPDATE, DELETE ON ALL TABLES IN SCHEMA dd TO dd_readwrite;
75
+ ALTER DEFAULT PRIVILEGES IN SCHEMA dd GRANT INSERT, UPDATE, DELETE ON TABLES TO dd_readwrite;
76
+ ```
77
+
78
+ This access can be granted using:
79
+
80
+ ```
81
+ GRANT dd_readwrite TO <your_login_user>;
82
+ ```
83
+
84
+
45
85
## Use Data Dictionary
46
86
47
87
Connect to your database using your favorite SQL client. This
You can’t perform that action at this time.
0 commit comments