复制表

最近更新时间: 2025-02-18 16:02:00

复制表是所有dn节点都存储一份相同的数据

  • 复制
    复制成功
postgres=# create table t_rep (id int,mc text) distribute by replication to group default_group;
CREATE TABLE
postgres=# insert into t_rep values(1,'TBase'),(2,'pgxz');
INSERT 0 2
postgres=# EXECUTE DIRECT ON (dn001) 'select * from t_rep';
 id |  mc   
----+-------
  1 | TBase
  2 | pgxz
(2 rows)

postgres=# EXECUTE DIRECT ON (dn002) 'select * from t_rep'; 
 id |  mc   
----+-------
  1 | TBase
  2 | pgxz
(2 rows)

我们可以看到所有节点都保存了一份相同的数据。