1

Does PostgreSQL provide change tracking feature like that on SQL Server. this is what I basically want. I want to move my data after few minutes intervals to other database. for this I just want to fetch changed data only in PGSQL through change tracking like that of SQL Server change tracking. What is the best way to achieve this?

Dale K
  • 25,246
  • 15
  • 42
  • 71
Ali Hussain
  • 765
  • 8
  • 27

2 Answers2

1

It's not so easy with PostgreSQL. You can use WAL’s aka Write Ahead Logs or triggers. May be the best approach will be using a external library like https://debezium.io

Deepstack
  • 96
  • 8
  • 2
    you don't need to read the WAL archives yourself. You can use [logical decoding](https://www.postgresql.org/docs/current/logicaldecoding.html) –  Nov 19 '20 at 18:58
1

I'm trying to achieve the same goal. This is what I found surfing the Internet. There are few possible approaches:

  • Streaming replication (ships a binary change log to a standby server)
  • Slony (uses triggers to accumulate DML changes into tables that are periodically shipped to standby servers)
  • Logical changeset logging
  • Audit trigger 91plus
Joseph Katzman
  • 1,959
  • 6
  • 21
  • 47
  • Hi, what you will suggest the best way among all these ways, I think stand by server data moving by using the Slony can be good one, as I can then use these trackings on the stand by db to move the changed data towards the sql server by using a running application i.e windows service – Ali Hussain Dec 20 '20 at 17:58