- DB作るところは公式ドキュメントと若干変えているので忘れないようにメモ
- ロールの作り方は公式ドキュメントに書いてなかったけどBitbucket Server(旧Stash)に合わせて作った。
postgres=# CREATE ROLE jiradbuser WITH PASSWORD 'xxxxxxxxxxxx';
CREATE ROLE
postgres=# ALTER ROLE jiradbuser LOGIN;
ALTER ROLE
postgres=# \du
List of roles
Role name | Attributes | Member of
jiradbuser | | {}
postgres | Superuser, Create role, Create DB, Replication | {}
stash | | {}
- 公式ドキュメントだとownerを指定してないけどせっかくロールを作ったので指定しておく。
postgres=# CREATE DATABASE jiradb WITH ENCODING 'UNICODE' LC_COLLATE 'C' LC_CTYPE 'C' TEMPLATE template0 OWNER=jiradbuser;
CREATE DATABASE
postgres=# \l
List of databases
Name | Owner | Encoding | Collate | Ctype | Access privileges
jiradb | jiradbuser | UTF8 | C | C |
postgres | postgres | UTF8 | ja_JP.UTF-8 | ja_JP.UTF-8 |
stash | stash | UTF8 | ja_JP.UTF-8 | ja_JP.UTF-8 |
template0 | postgres | UTF8 | ja_JP.UTF-8 | ja_JP.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
template1 | postgres | UTF8 | ja_JP.UTF-8 | ja_JP.UTF-8 | =c/postgres +
| | | | | postgres=CTc/postgres
(5 rows)
参考
- 日本語ドキュメント(ちょっとバージョンが古いので最新のドキュメントと少し違う)
- 最新ドキュメント(基本的にコチラのやり方に合わせてます)