一千萬個為什麽

搜索

使用PostgreSQL回滾到特定時刻

有沒有辦法回滾到特定的起點。 我正在尋找這樣的東西。

啟動specific_point;

Now after this, an other application connected with the SAME login will insert & delete datas (webservices with crud operations) for about 2 minutes doing tests. Each webservice call is declared as a transaction with Spring Ws.

之後,我想回滾到specific_point以使幹凈的數據庫處於已知的先前狀態。

我在想 ROLLBACK TO SAVEPOINT foo;是解決方案,但不幸的是?

任何想法 ?

配置:PostgreSQL 8.4/windows XP

問候

最佳答案

兩個快速選項:

  1. Create a temporary database using the primary database as a template, drop the temporary database when finished testing.
  2. Table Log might be helpful in implementing something.

轉載註明原文: 使用PostgreSQL回滾到特定時刻