Hi BDR PostgreSQL experts,
I am recently trying out the logical decoding with Replica Identity Full using postgresql-bdr94-server.To reproduce:
test1=# create table test (i int primary key, t text);
CREATE TABLE
test1=# alter table test replica identity full;
ALTER TABLE
test1=# insert into test values (1, 'hello');
INSERT 0 1
test1=# SELECT * FROM pg_create_logical_replication_slot('regression_slot', 'test_decoding');
slot_name | xlog_position
-----------------+---------------
regression_slot | 0/70BBAB0
(1 row)
cucm=# SELECT * FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL);
location | xid | data
----------+-----+------
(0 rows)
test1=# update test set t='world';
ERROR: Cannot run UPDATE or DELETE on table test because it does not have a PRIMARY KEY.
HINT: Add a PRIMARY KEY to the table
CREATE TABLE
test1=# alter table test replica identity full;
ALTER TABLE
test1=# insert into test values (1, 'hello');
INSERT 0 1
test1=# SELECT * FROM pg_create_logical_replication_slot('regression_slot', 'test_decoding');
slot_name | xlog_position
-----------------+---------------
regression_slot | 0/70BBAB0
(1 row)
cucm=# SELECT * FROM pg_logical_slot_get_changes('regression_slot', NULL, NULL);
location | xid | data
----------+-----+------
(0 rows)
test1=# update test set t='world';
ERROR: Cannot run UPDATE or DELETE on table test because it does not have a PRIMARY KEY.
HINT: Add a PRIMARY KEY to the table
FYI, the exact same command works just fine on stock PG9.4.5
And here is the postgresql bdr package that i used
[root@bdr301 /]# rpm -qa |grep post
postgresql-bdr94-2ndquadrant-redhat-1.0-3.noarch
postgresql-bdr94-libs-9.4.15_bdr1-1.el6.x86_64
postgresql-bdr94-contrib-9.4.15_bdr1-1.el6.x86_64
postgresql-bdr94-bdr-1.0.3-3.el6.x86_64
postgresql-bdr94-9.4.15_bdr1-1.el6.x86_64
postgresql-bdr94-server-9.4.15_bdr1-1.el6.x86_64
postgresql-bdr94-2ndquadrant-redhat-1.0-3.noarch
postgresql-bdr94-libs-9.4.15_bdr1-1.el6.x86_64
postgresql-bdr94-contrib-9.4.15_bdr1-1.el6.x86_64
postgresql-bdr94-bdr-1.0.3-3.el6.x86_64
postgresql-bdr94-9.4.15_bdr1-1.el6.x86_64
postgresql-bdr94-server-9.4.15_bdr1-1.el6.x86_64
Thanks!
Ning