Either try placing the 'md5' entries before the 'trust' entries, or remove the 'trust' entries. Because you have the 'trust' method first, it will be used. Secondly, your pg_hba configuration is an issue. SELECT * FROM dblink('dbname=my_db_name user=my_user password=password hostaddr=127.0.0.1', 'SELECT action, object, created_at, id FROM my_table') AS de(ACTION VARCHAR, OBJECT VARCHAR, created_at TIMESTAMP, id INT) This should fix the issue where it tries to authenticate as my_user.
Try removing the commas from the connection string.