Table of Contents
方案一:
a. 创建表空间
># mkdir -p /data/pgsqldata/test_tbsp
># chown -R postgres:postgres /data/pgsqldata/test_tbsp
psql=#create tablespace test_tbsp location '/data/pgsqldata/test_tbsp';
b. 创建用户
create user test with password 'test';
c.创建指定表空间,指定用户的数据库
create database test owner=test tablespace=test_tbsp;
d.写函数需要的语言
su - postgres -c"createlang plpgsql saservice"
方案二:
a.建用户(linux环境)
># createuser test –s
b.建表空间实际存在的文件夹,并给权限(linux环境)
># mkdir /data/pgsqldata/test_tbs
># chown postgres:postgres /data/pgsqldata/test_tbs
c.创建表空间(psql环境)
DB=# create tablespace test_tbs location '/data/pgsqldata/test_tbs';
d.创建数据库(linux环境)
># createdb test -D test_tbs -O test
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




