1.创建用户
2.创建表空间
3.创建表空间目录及授权
4.测试创建用户
下节内容,主要讲解对库表的操作,以及查看表的定义,查看表及索引的空间,查看函数代码等内容,敬请期待
-- 创建测试库,归属为用户pguser,同时为mytest库分配一个新的表空间tbs_mytest
create role pguser with encrypted password 'pguser';
mkdir -p /database/pg/pg_tbs/tbs_mytest
chown -R postgres:postgres /database/pg/pg_tbs/tbs_mytest
create tablespace tbs_mytest owner pguser location '/database/pg/pg_tbs/tbs_mytest';
create database mytest
with owner = pguser
template = template0