AW: BUG #17393: Delete database after recovery with point-in-time is still missing datafiles

From: "Lorenz, Christopher" <Christopher(dot)Lorenz(at)ZIT-BB(dot)Brandenburg(dot)de>
To: "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: AW: BUG #17393: Delete database after recovery with point-in-time is still missing datafiles
Date: 2022-04-04 07:00:02
Message-ID: 592564ffc7c34699b869aee3a492e1fb@ZIT-BB.Brandenburg.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

Thanks for your explanation. I makes sense cause the DML command DROP isn't transactional so it don't have a COMMIT which can be rolled back. I also can get an valid restore if I set an recovery_target_name before. In most cases I don't have the txid or a named recovery point, cause the DROP was done accidentally.

I've don't test it, but to get a restore as I need:
- Run a recovery to get the txid and exactly time of the DROP, so I also have the last wal I've have to start looking
- find out the last txid of a COMMIT before current stopping point of recovery using pg_waldump, decreasing the txid by 1 isn't sure cause the txids are maybe unordered
- Run the recover a second time with supplied txid to stop after the transaction before the DROP (recovery_target_xid)

> This is not a bug, rather a limitation of recovery_target_time.

I know this is not "real" a bug, it should be in the documentation (I don't found this anywhere in context of recovery). Or better I should be printed out in log of the recovery if it happened. This case of recovery produce an postgresql cluster with database (which is show in list of databases) without datafiles. It recovered a corrupt database which isn't fine. After it happened for me I spend time to find the reason of the faulty recovery.

If postgresql is doing an empty commit before DML commands it should also work.

Regards

Christopher Lorenz

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message qiumingcheng 2022-04-05 05:41:57 a code question
Previous Message Tom Lane 2022-04-03 16:42:34 Re: BUG #17454: Using psql without ipv4 address,the inet_server_port do not return PORT.