We do have a requirement to create a db_link(Database link) have to refer to the same database.
When I am looking at the code in the function. It is some how like this.
perform dblink_connect(cn,'loopback'::text);
cn is the connection name;
I verified if there are any foreign servers with the name loopback by using this query. But, no luck
select
srvname as name,
srvowner::regrole as owner,
fdwname as wrapper,
srvoptions as options
from pg_foreign_server
join pg_foreign_data_wrapper w on w.oid = srvfdw;
I suspect that loopback refers to the same database.
When I execute the Function, I am receiving the below error
**Error:password is required**
I verified the db_link extension it's there and dblink_fdw is also there
Environment:Postgres RDS