我有一个名为pg_service.conf的文件,其中包含以下配置:
pg_service.conf
[test-service]
host=localhost
port=5432
user=test-user
password=*****
dbname=test-table
运行以下查询时出现错误
查询
SELECT id, name
FROM
DBLINK('service=test-service',
'SELECT id, name FROM student'
) AS sq0(id int, name text) order by 1;
错误
ERROR: could not establish connection
DETAIL: definition of service "test-service" not found
SELECT id, name FROM DBLINK('server=test-localhost port=5432 user=test-user password=*** dbname=dbname ', 'SELECT id, name FROM student' ) AS sq0(id int, name text) order by 1;
。 - Vivek S.