how to restore postgres database from tar backup file code example Example: restore postgres database from sql file psql -d database_name -f backup.sql