回答編集履歴
1
詳細に記述しなおします。
test
CHANGED
@@ -1,9 +1,85 @@
|
|
1
|
-
postgres ユーザになって
|
1
|
+
postgres ユーザになって
|
2
2
|
|
3
3
|
|
4
4
|
|
5
5
|
```bash
|
6
6
|
|
7
|
+
$ psql
|
8
|
+
|
9
|
+
psql (9.6.5)
|
10
|
+
|
11
|
+
"help" でヘルプを表示します.
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
postgres=# create database spring owner spring;
|
16
|
+
|
17
|
+
ERROR: role "spring" does not exist
|
18
|
+
|
19
|
+
postgres=# create user spring;
|
20
|
+
|
21
|
+
CREATE ROLE
|
22
|
+
|
23
|
+
postgres=# create database spring owner spring;
|
24
|
+
|
25
|
+
CREATE DATABASE
|
26
|
+
|
27
|
+
postgres=# \du
|
28
|
+
|
29
|
+
ロール一覧
|
30
|
+
|
31
|
+
ロール名 | 属性 | メンバー
|
32
|
+
|
33
|
+
----------+------------------------------------------------------------------------------------------------+----------
|
34
|
+
|
35
|
+
postgres | スーパーユーザ, ロールを作成できる, DBを作成できる, レプリケーション, 行単位セキュリティを無視 | {}
|
36
|
+
|
37
|
+
spring | | {}
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
postgres=# \q
|
42
|
+
|
7
|
-
dropuser spring
|
43
|
+
$ dropuser spring
|
44
|
+
|
45
|
+
dropuser: ロール"spring"の削除に失敗しました:ERROR: role "spring" cannot be dropped because some objects depend on it
|
46
|
+
|
47
|
+
DETAIL: owner of database spring
|
48
|
+
|
49
|
+
$ psql
|
50
|
+
|
51
|
+
psql (9.6.5)
|
52
|
+
|
53
|
+
"help" でヘルプを表示します.
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
postgres=# drop database spring;
|
58
|
+
|
59
|
+
DROP DATABASE
|
60
|
+
|
61
|
+
postgres=# \q
|
62
|
+
|
63
|
+
$ dropuser spring
|
64
|
+
|
65
|
+
$ psql
|
66
|
+
|
67
|
+
psql (9.6.5)
|
68
|
+
|
69
|
+
"help" でヘルプを表示します.
|
70
|
+
|
71
|
+
|
72
|
+
|
73
|
+
postgres=# \du
|
74
|
+
|
75
|
+
ロール一覧
|
76
|
+
|
77
|
+
ロール名 | 属性 | メンバー
|
78
|
+
|
79
|
+
----------+------------------------------------------------------------------------------------------------+----------
|
80
|
+
|
81
|
+
postgres | スーパーユーザ, ロールを作成できる, DBを作成できる, レプリケーション, 行単位セキュリティを無視 | {}
|
82
|
+
|
83
|
+
|
8
84
|
|
9
85
|
```
|