Jeremy Finzel <finz...@gmail.com> writes: > A related problem kind of demonstrates the same odd behavior. If you put > in recovery_target_xid to a subtransaction_id, it just skips it and > continues recovering, which really seems to be undesirable behavior. It > would be nice if that also could roll up to the next valid actual commit > transaction.
It would seem like what you're asking for is to continue until the commit of the parent transaction, not just the next commit after the subcommit. Otherwise (if that's an unrelated xact) the subxact would still not be committed, so that you might as well have stopped short of it. I'd be in favor of that for recovery_target_xid, but I'm not at all convinced about changing the behavior for a target LSN. The fact that the target is a subcommit seems irrelevant when you specify by LSN. I don't recall this for sure, but doesn't a parent xact's commit record include all subxact XIDs? If so, the implementation would just require searching the subxacts as well as the main XID for a match to recovery_target_xid. regards, tom lane