Updated: now can be run in a way you can do commands before and after
Removed: magical behavior with --create is wrong

Despite you specify the database with -d, pg_restore will use the stored
database name instead.

The other problem was the "temporary" database on which you connect. It
looks nasty.
Updated: tar dump, better implementation and streamable