I am trying to execute a .sql file using UNIX command line for postgres 9.5. I have tried
psql -s localhost -d postgres < filename.sql
where postgres
is the name of my database, as well as
psql postgres username < filename.sql
and also
psql -af filename.sql
and I get the result:
Usage: /Library/PostgreSQL/9.5/scripts/runpsql.sh [wait]
for each of these runs. The scripts did not seem to execute, but got no error messages. I am running on Mac OSX.