Questions tagged [logical-replication]

Logical replication is a feature of PostgreSQL 10. It is a method of replicating data objects and their changes, based upon their replication identity (usually a primary key)

113 questions
28
votes
2 answers

Find Replica Identity for a Postgres table

Is there a way to see what kind of replica identity a Postgres table has, whether using pgAdmin or through a query?
svakili
  • 1,909
  • 4
  • 19
  • 24
6
votes
0 answers

postgresql Logical Replication Stream fails with "Database connection failed when reading from copy"

Hi I am reading from logical replication stream continuously in infinite while loop. and I have another program that is continuously populating a table in the same database. I notice that after some time (around 5-10 minutes). I always get the…
5
votes
0 answers

Movement of restart_lsn position movement of logical replication slots is very slow

We have two logical replication slots in our postgresql database (version-11) instance and we are using pgJDBC to stream data from these two slots. We are ensuring that when we regularly send feedback and update the confirmed_flush_lsn (every 10…
5
votes
3 answers

How to limit WAL size when using Postgres Logical Replication Slot?

I am creating replication slot and streaming changes from AWS Postgres RDS to java process through JDBC driver. My replication slot creation code looks like this. final ReplicationSlotInfo replicationSlotInfo = pgConnection.getReplicationAPI() …
dnsh
  • 3,516
  • 2
  • 22
  • 47
5
votes
1 answer

PostgreSQL logical replication - create subscription hangs

I am trying to set logical replication between 2 cloud instances both with Debian 9 and PG 11.1. The command CREATE PUBLICATION on master was successful, but when I start the command CREATE SUBSCRIPTION on the intended logical replica, the command…
JosMac
  • 2,164
  • 1
  • 17
  • 23
5
votes
2 answers

Logical Replication and Declarative Partitioning in PostgreSQL 11

I have a regular table transactions with 200 million rows. I decided to convert this table to a Declarative Partition using Logical Replication. I created a Publication on node1 like so: CREATE PUBLICATION transactions_pub FOR TABLE…
5
votes
1 answer

Postgres Notify not working with logical replication

I am replicating data from Postgres 10.4 to another Postgres 10.4 instance using logical replication. The subscriber has several triggers that log events to a single table. This table has a trigger that executes another function (that returns a…
user3186332
  • 345
  • 3
  • 13
4
votes
1 answer

postgres logical replication starting from given LSN

Postgres logical replication initial synchronization is very slow process, especially if original database is quite big. I am wondering if it possible to start replication from given LSN? The desired work flow will be obtain current LSN from source…
4
votes
1 answer

Can't delete from table after switch from logical to streaming replication

On my DEV server I tested logical replication, and return to streaming after that. Now wal_level = replica and I have two slaves: pid |state |application_name |client_addr|write_lag |flush_lag |replay_lag …
Slava Rozhnev
  • 9,510
  • 6
  • 23
  • 39
3
votes
1 answer

Debezium with RDS postgres and master-replica failover

I have an RDS multi-AZ postgres database (primary-standby) and I'm investigating Debezium to stream changes to Kafka. I was reading the documentation of what could go wrong in case of failover:…
3
votes
1 answer

PostgreSQL logical replication not working after added a new table to publication

I am new to PostgreSQL logical replication. I did test, after I added a new table to a publication, I found the replication didn't work, until I re-created subscription, I am sure it's not the best practice to re-create subscription, could you…
aris yang
  • 41
  • 1
  • 2
3
votes
2 answers

PostgreSQL logical replication - ignore pre-existing data

Imagine dropping a subscription and recreating it from scratch. Is it possible to ignore existing data during the first synchronization? Creating a subscription with (copy_data=false) is not an option because I do want to copy data, I just don't…
Max Malysh
  • 29,384
  • 19
  • 111
  • 115
3
votes
1 answer

PostgreSQL 10 Logical Replication: Double entries or primary key conflict

I have built a master -> slave setup with PostgreSQL 10 to sync data from some specific tables to the slave machine, which is the public system. Now during the whole time, I encounter some strange behaviour: Some tables do not sync at all. Looking…
resonic
  • 31
  • 3
2
votes
2 answers

Does PostgreSQL support replicating only a subset of the publishing columns?

I've been reading about logical replication in PostgreSQL, which seems to be a very good solution for sharing a small number of tables among several databases. My case is even simpler, as my subscribers will only use source tables in a read-only…
coterobarros
  • 941
  • 1
  • 16
  • 25
2
votes
1 answer

PostgreSQL 13.3 Logical Replication doesn't create the replication slot in the master

I'm new in PostgreSQL. I'm trying to create a logical replication of 2 databases that are in the same localhost and port (I don't know if that's part of the problem that I'm having). The point is, that I create the publication with no problem, but,…
1
2 3 4 5 6 7 8