I'm using a PostgreSQL database and postgres_fdw extension to query external data.
CREATE EXTENSION postgres_fdw;
CREATE SERVER foreign_fake_database
FOREIGN DATA WRAPPER postgres_fdw
OPTIONS (host '....', port '5432', dbname 'fake_database');
When I create the user mapping to query this external database, I must write in clear, username and password:
CREATE USER MAPPING FOR fake_user SERVER foreign_fake_database
OPTIONS ("user" 'fake_user', password 'fake_password');
This method seems fragile to me for obvious security reasons so I'm looking for users feedbacks.
What are the best practices to maintain a good level of security and not have the password stored in clear ? Can I encrypt this password? With multiple users, is it okay to use the same user to connect? Doesn't it overload the system or create conflict?
\deu?