PostgreSQL does not have a feature like FLASHBACK, as seen in Oracle. Flashback in Oracle is used to take the database back to a certain point in time when some accidental changes were performed. It relies on redo logs, undo, and the flash recovery area. However, for faster point-in-time recovery in PostgreSQL, we can always set up a delayed replica/standby so that the standby is always lagging by a certain amount of time. We can always delay the replica by a certain amount of time – let's say, hours, minutes, days, or even seconds. This way, if someone dropped a table accidentally, we could perform a switchover to the standby that is lagging by a certain amount of time.
In this recipe, we shall discuss how a delayed standby can be set up. In order to avoid duplication, I am going to skip the steps involved in setting up streaming replication, which was discussed in the previous recipe, Setting up streaming replication...