PostgreSQL备份过程中,如果存在插入/更新/删除操作,最终状态如何?

huangapple go评论70阅读模式
英文:

What is the final state of a PostgreSQL dump if there are inserts/updates/deletes during the backup process?

问题

如果在进行pg_dump备份PostgreSQL数据库时,同时对所有表执行插入/更新/删除操作,会发生什么情况?备份是否一致?备份的内容将会是什么?

如果在备份过程中采取了某种锁定机制,是否会阻止我进行插入/更新/删除操作?

或者备份过程会忽略在备份启动后启动的所有操作的结果吗?如果是这样,具体是如何工作的?所有操作的结果保存在哪里?

英文:

What happens if I'm making insert/update/delete operations on a PostgreSQL database (on all tables at the same time) while it's being backup-ed with pg_dump? Is the dump consistent? What will be the content of the dump?

If some sort of locking mechanism is being placed during the backup, will that prevent me from doing insert/update/delete operations?

Or maybe the backup process will ignore the results of all operations launched after the backup process was started? If so, how does that work exactly? Where are the results of all operations saved?

答案1

得分: 1

从手册中引用

即使数据库正在同时使用,它也能创建一致的备份。

该转储将包含数据库在开始转储时的状态。有关如何实现这一点的详细信息,请参阅并发控制的介绍。

英文:

Quote from the manual

> It makes consistent backups even if the database is being used concurrently

The dump will contain the state of the database as it was at the moment the dump was started. For details on how this is achieved, see the introduction to Concurrency Control

huangapple
  • 本文由 发表于 2020年1月3日 18:39:06
  • 转载请务必保留本文链接:https://go.coder-hub.com/59577070.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定