On Tue, Jan 11, 2022 at 11:10 AM dulhaver via Barman, Backup and
Recovery Manager for PostgreSQL <
pgba...@googlegroups.com> wrote:
> correct. No other activity between those 2 events.
>
I could have misunderstood your goal: you want to return to 6:35 that
is the last time the database had acitivity. This is equivalent to
restore without any target time, as far as I understand your
experiment.
Now, what is strange is that your database is not there, and this
could be due to a rush in starting the recovery. Could it be the
system did not archive the last WAL, thus your backup is incomplete?
> However I would have assumed that CREATE DATABASE is a valid transaction on a postgres cluster that should be written into a wal file.
> apparently my basic understanding insufficient yet.
Yes and no. Surely create database is written to the WALs, but AFAIK
you cannot rollback such operation, so it is not a transaction per-se.
> are you implying database writes (like INSERT INTO on an existing db) would have had more chance to be recreated of they would have occured?
> or is --target-time the entire wrong approach?
The recovery target time/transaction depends on what you are going to achieve.
I would repeat the experiment with either traffic after the create
database (e.g., a bulk set of inserts) or adding a wal_timemout option
to your PostgreSQL configuration.
Since you did not specify your setup and what you are trying to
achieve, it is hard to guess what did not match your expectetions.
Luca