Context
I have a simple pg_service.conf
file located at ${HOME}/pg_service.conf
which content is as follow:
# comment
[service_name]
host=localhost
port=5432
dbname=databasename
user=username
Issue
Whenever I try to create a new server from pgAdmin III by setting 'service_name' under the option 'Service', I encounter this error message:
I also tried to copy the pg_service.conf
file nearby the .pg_hba.conf
and restarting PostgreSQL; the same problem occurred.
A same error occurs when I try to run a psql
command:
psql: definition of service "service_name" not found
How could I make it work?
I found this, but that doesn't help me much because it's for Windows users.
Environment
I'm on Ubuntu 18.04 using "PostgreSQL 10.12 (Ubuntu 10.12-0ubuntu0.18.04.1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0, 64-bit"
.