I have pg_service.conf file with following config
pg_service.conf
[test-service]
host=localhost
port=5432
user=test-user
password=*****
dbname=test-table
While running following query shows error
Query
SELECT id, name
FROM
DBLINK('service=test-service',
'SELECT id, name FROM student'
) AS sq0(id int, name text) order by 1;
ERROR
ERROR: could not establish connection
DETAIL: definition of service "test-service" not found