I am trying to create a script which creates a postgres-fdw connection between two postgres 9.4 databases. The script (which is checked in under version control), has been relying on pgpass to do other things. Is there any option I can use to request that the password be looked up in pgpass? … in general, where is the documentation on what options are available for CREATE USER MAPPING
? the reference just says that options depend on the server.
Postgresql – Rely on .pgpass in CREATE USER MAPPING
foreign-datapostgresqlpostgresql-9.4
Related Question
- PostgreSQL – Fixing Vagrant VM Extension Creation Issues
- Postgresql – Postgres and Windows AD using windows authentication
- Postgresql – SQLAlchethe connection error with Postgres
- PostgreSQL – Can `listen_addresses` Prevent Pre-Authentication Exploits?
- Postgresql – Unable to import shapefile into PostGisDatabase – problem of connection
- Postgresql – user mapping hide password
Best Answer
It may not fully answer your question, but:
If you specify a user mapping for a
superuser
forpostgres_fdw
you can specify it without a password. It will then rely on the.pgpass
from the server.By using a mapping for a
superuser
you will however need to think about what security concerns this raises for your usage.Data source:
Own DB:
~/.pgpass
of thepostgres
OS user contains:sales.db:*:sales:sales_reader:verysecret
Example session showing the difference between
NOSUPERUSER
andSUPERUSER
: