Database DB_B is a copy of DB_A. DB_B is less than an hour old but DB_A is live until the users are switched over to DB_B. How do I track the changes made during that interval? I will know the time that the copy was made. I can't be adding extra columns or tables to DB_A unless they are small changes and/or don't affect business.
This is my current script. Can I do better than this?
SELECT
[name]
,create_date
,modify_date
FROM
sys.views
WHERE
modify_date > '26 July 2023 15:50:00'
Idealy I would like anough information from DB_A to create an insert/update script on DB_B
Is this possible?
1条答案
按热度按时间whitzsjs1#
This sounds like a job for transaction log or replication.
https://blog.pythian.com/monitoring-transaction-logs-in-postgresql/
https://www.cherryservers.com/blog/how-to-set-up-postgresql-database-replication
Or, triggers might also work:
https://www.postgresql.org/docs/current/sql-createtrigger.html
And if none of those options work, query a timestamp on every column.