PostgreSQL 创建表空间测试

PostgreSQL 的表空间的创建命令比较简单。

Command:     CREATE TABLESPACE
Description: define a new tablespace
Syntax:
CREATE TABLESPACE tablespace_name [ OWNER user_name ] LOCATION 'directory'
Command:     CREATE DATABASE
Description: create a new database
Syntax:
CREATE DATABASE name
    [ [ WITH ] [ OWNER [=] user_name ]
           [ TEMPLATE [=] template ]
           [ ENCODING [=] encoding ]
           [ LC_COLLATE [=] lc_collate ]
           [ LC_CTYPE [=] lc_ctype ]
           [ TABLESPACE [=] tablespace_name ]
           [ CONNECTION LIMIT [=] connlimit ] ]

可能的错误

 create tablespace testspaceeee location '/mnt/data1222';
ERROR:  directory "/mnt/data1222" does not exist

表空间目录必须提前创建好。


postgresql 的归档模式设置

wal_level = archive 


checkpoint_segments = 3         # in logfile segments, min 1, 16MB each
checkpoint_timeout = 10min               # 强制生成 checkpoint 的周期 
checkpoint_completion_target = 0.5      # checkpoint target duration, 0.0 - 1.0
checkpoint_warning = 30s                # 0 disables
archive_mode = on               # 启动归档模式
                                # 
archive_command ='cp %p /home/postgres/data1/%f'            
                                # 
                                #              
                                # 归档路径
archive_timeout = 120           # 
                                # 
阅读更多
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/zdc524/article/details/49924487
个人分类: postgresql
上一篇PostgreSQL 性能测试工具
下一篇ubuntu下安装postgresql 安装
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭