Postgresql pg_dumpall restore one database

postgresqlpostgresql-9.2

My environment:

# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 7.3 (Maipo)
# rpm -q postgresql
postgresql-9.2.18-1.el7.x86_64
# 

I used following PostgreSQL: Documentation: 9.6: pg_dumpall to take dump all databases

$ pg_dumpall > db.out

from what I understand, following will restore all databases:

$ psql -f db.out postgres

my goal is, I need to restore just a one (single) database from that entire dump, how does one accomplish this task?

Best Answer

Your dump is in SQL format. Just open your db.out file remove what's for other databases.