export PGPASSWORD=<password>
psql
-h <host>
-d <db>
-U <user>
-p 5432
-a
-q
-f <path_to_file>
easiest and most used way to run any SQL file in PostgreSQL is via its SQL shell.
Open the SQL shell from the menu bar of Windows 10.
Add your server name, database name where you want to import the file, the port number you are currently active on, PostgreSQL username, and password to start using SQL shell.