For Mac OS
go to /Applications/Postgres.app/Contents/Versions/latest/Bin
./psql {database_name_to_backup} < /Users/Thirumal/Documents/{database_name_to_backup}.sql
For Ubuntu
, login with postgres
user
sudo su postgres
psql
create {database_name};
\q
Syntax:-
psql -U {userName} {databaseName} < {backup-file}.sql
Example:-
psql -U postgres authorization-server < authorization-server.sql