For PostgreSQL it takes a lot of time to import a text-based dump.
It turns out that binary dumps are imported much faster.
To create a binary dump run:
pg_dump -Fc dbname > /tmp/database.bak
Creating a database upon dump import should work, but for me it didn’t on PostgreSQL 9.4, so I recommend first creating the database and then running:
pg_restore -Fc /tmp/database.bak -d dbname