Server closed the connection unexpectedly. This probably means the server terminated abnormally before or while processing the request

Viewed 9848

I've been trying to import a .sql file from a local directory into my PostgreSQL database ("bikeshare"). I'm currently using Linux OS (Ubuntu)

I made the recommended adjustments to both files listed below:

  1. /etc/postgresql/10/main/postgresql.conf (tried listen_address = "*" and "::")

  2. /etc/postgresql/10/main/pg_hba.conf (local all postgres md5)

I've also tried allowing access to all databases for all users with an encrypted password. (host all all 0.0.0.0/0 md5)

Every time I try this (after changing into a directory with the .sql file):

$ psql -U Postgres -d bike-share -f status.sql

I get this error message:

psql:/home/glenn/Documents/PostgreSQL/status.sql:27612953: server closed the connection unexpectedly
    This probably means the server terminated abnormally
    before or while processing the request.
psql:/home/glenn/Documents/PostgreSQL/status.sql:27612953: connection to server was lost

I've also tried doing this:

$ sudo -u postgres psql
postgres=# \c bikeshare
postgres=# \i '/home/glenn/Documents/PostgreSQL/status.sql'

And this:

$ psql -h Glenn -d bikeshare -U postgres -f status.sql

And every time I get the same error above.

Is there a step I'm missing?

0 Answers
Related