I want to you table which is located in the other database.
I am using the dblink for this.
Procedure:
Step 1: Created extension.
CREATE EXTENSION dblink;
Step 2: Making dblink connection string.
select dblink_connect('con','host=127.0.0.1 dbname=makdb user=postgres password=postgres');
Step 3:
select * from dblink('con','select cola,colb from tbl_test') as tbl(cola int,colb varchar(10));
My Question: How do i hide password in step 2?
By searching i came to know that i need to create .pgpass
file. But got stuck in how to create and in which step i need to use that file name.