I know this is not new, but I have not found a solution, even though I have followed several posts in this forum.
I'm trying to show table from different database using
dblink using :
CREATE EXTENSION dblink
And run successfully. In
db1 then I try querying, like:
SELECT * FROM dblink('dbname=db_name2 port=5432 host=xx.xx.x.x user=username_db2 password=password_db2', 'SELECT * FROM tableFrom_Db2');
I always get notice like this:
ERROR: a column definition list is required for functions returning "record"
To make sure that the connection is going well, I tried
SELECT dblink_connect('host=xx.xx.x.x user=username_db2 password=password_db2 dbname=db_name2');
And I get notice like :
ERROR: could not establish connection
DETAIL: FATAL: no pg_hba.conf entry for host "IP_db1", user "username_db2", database "db_name2", SSL on
FATAL: no pg_hba.conf entry for host "IP_db1", user "username_db2", database "db_name2", SSL off
By the way What's wrong?