pg_restore: [archiver] input file appears to be a text format dump. Please use psql

Viewed 4016

I was trying to create a new database (analyses_db) on a remote server from a sql file by the command:

pg_restore -d analyses_db byoryn_resource.sql

I received the error message

pg_restore: [archiver] input file appears to be a text format dump. Please use psql.`

When I tried to follow the instruction: (from https://stackoverflow.com/a/40632316/15721796)

To reload such a script into a (freshly created) database named newdb:
$ psql -d newdb -f db.sql

I received:

psql: could not connect to server: No such file or directory
        Is the server running locally and accepting
        connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

I have no idea how to solve this, as a rookie. The SQL file should be alright as it is provided.

1 Answers
Related