統計情報提供システム - DB部署
Copyright Notice: This article is an original work licensed under the CC 4.0 BY-NC-ND license.
If you wish to repost this article, please include the original source link and this copyright notice.
Source link: https://v2know.com/article/1254
數據庫tsttpg
1. General:

2. Definition:

3. Security:

4. Parameters:

5. Default Privileges:

6. Advanced:

7. SQL:

創建Owner
但是在這之前得先創建Owner:

沒有Owner無法完成數據庫的創建。
這裏參考原版數據庫:
1. General:

2. Definition:

3. Privileges:

4. Membership:

5. Parameters:

6. Security:

7. SQL:

操作結果:

CREATE ROLE tstt WITH
LOGIN
SUPERUSER
NOCREATEDB
NOCREATEROLE
INHERIT
NOREPLICATION
NOBYPASSRLS
CONNECTION LIMIT -1
ENCRYPTED PASSWORD 'tstt';

CREATE DATABASE tsttpg
WITH
OWNER = postgres
ENCODING = 'UTF8'
LC_COLLATE = 'Japanese_Japan.932'
LC_CTYPE = 'Japanese_Japan.932'
LOCALE_PROVIDER = 'libc'
TABLESPACE = pg_default
CONNECTION LIMIT = -1
IS_TEMPLATE = False;
GRANT TEMPORARY, CONNECT ON DATABASE tsttpg TO PUBLIC;
GRANT ALL ON DATABASE tsttpg TO postgres;
GRANT ALL ON DATABASE tsttpg TO tstt;
※注意:創建owner的時候并不是不要輸入密碼,這裏我忘記了,請去property裏面給password設置成tstt。
其實後面我發現,好像完全不需要建立這個數據庫:

説不定連role都不需要。

好吧,是我錯了,這個role還是需要創建的。
This article was last edited at