I have reviewed this patch and it compiles runs and the new test case passes. The code is also clean and the test seems like a useful regression test.
What I do not like though is how the path src/test/tables_fk/t/ tells us nothing about what features are of PostgreSQL are tested here. For this I personally prefer the earlier versions where I think that was clear.
Another though: would it be worthwhile to also add an assertion to check if the data really was restored properly or would that just be redundant code?