pgpass (in)flexibility - Mailing list pgsql-general

From Ben Chobot
Subject pgpass (in)flexibility
Date
Msg-id FF2C2472-6200-4052-B7CB-2D1C75272AD4@silentmedia.com
Whole thread Raw
Responses Re: pgpass (in)flexibility
Re: pgpass (in)flexibility
List pgsql-general
We're in a situation where we would like to take advantage of the pgpass hostname field to determine which password
getsused. For example: 

psql -h prod-server -d foo # should use the prod password
psql -h beta-server -d foo # should use the beta password

This would *seem* to be simple, just put "prod-server" or "beta-server" into the hostname field of .pgpass. But if
somebodyuses the FQDN of those hosts, then the line does not match. If somebody uses the IP address of those hosts,
again,no match. It seems that the hostname must match the hostname *exactly* - or match any host ("*"), which does not
workfor our use case. 

This seems to make the hostname field unnecessarily inflexible. Has anybody else experienced - and hopefully overcome -
thispain? Maybe I'm just going about it all wrong. 

pgsql-general by date:

Previous
From: Melvin Davidson
Date:
Subject: Re: clone_schema function
Next
From: Jim Nasby
Date:
Subject: Re: avoid lock conflict between SELECT and TRUNCATE