在MogDB中,比较常用的物理备份工具是gs_basebackup和gs_probackup,后者的功能相对更加完善一些。本文主要测试如何在有自定义表空间存在的数据库进行物理备份与恢复以及需要注意的点。
1.创建自定义表空间my_tablespace
postgres=# create tablespace my_tablespace location '/data/mog5';
CREATE TABLESPACE
2.在my_tablespace中新建测试表t
postgres=# create table t(id int) tablespace my_tablespace;
CREATE TABLE
postgres=# insert into t values(1),(2);
INSERT 0 2
postgres=# \d+ t