Is it possible to create a replica from a database that only inserts and updates replicated and not deletes in PostgreSQL ?

2 Answers 2


The Postgres logical replication protocol allows you to identify the change type, so you can write a custom decoder that filters out messages that you want to ignore.

Alternatively, you could use an existing third-party CDC solution that allows filtering by message attributes, such as Debezium.

  • built-in pgoutput plugin is enough, no need to write a separate decoder. create publication ... with (publish = 'insert, update')
    – Melkij
    Jun 6, 2023 at 6:17

By default, I would say no, but you have some options:

  • You can use triggers (with DBLinks if you want to send to another server).
  • You can also use Change Data Capture (CDC).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.