我使用的是在Rails应用程序PostgreSQL的Slony聚-I复制多分贝的宝石。这大多完美地工作,但在某些情况下复制滞后。其中一种情况涉及ActiveRecord counter_cache。 为了清楚起见,假设以下两种模式: class Post < ActiveRecord::Base
has_many :comments
...
end
class Comme
样品slonik命令: slonik <<_EOF_
#--
# define the namespace the replication system uses in our example it is
# slony_example
#--
cluster name = $CLUSTERNAME;
#--
# admin conninfo's are used by sloni
我有一个正在由slony备份的数据库。我从复制的数据库中删除了一个表,并使用sql脚本重新创建了相同的表,而没有通过slony脚本创建。 我发现这个在一立柱和试了一下: 重新创建表 获取重新创建表的OID:SELECT OID from pg_class WHERE relname = <your_table>' AND relkind = 'r'; 更新在sl_table的tab_reloid的